Removed deprecated code.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1001681 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bde7476da5
commit
dcbe5c7caf
|
@ -16,8 +16,6 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.commons.math.distribution;
|
package org.apache.commons.math.distribution;
|
||||||
|
|
||||||
import org.apache.commons.math.MathException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Computes the cumulative, inverse cumulative and density functions for the beta distribuiton.
|
* Computes the cumulative, inverse cumulative and density functions for the beta distribuiton.
|
||||||
*
|
*
|
||||||
|
@ -25,41 +23,26 @@ import org.apache.commons.math.MathException;
|
||||||
* @version $Revision$ $Date$
|
* @version $Revision$ $Date$
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
*/
|
*/
|
||||||
public interface BetaDistribution extends ContinuousDistribution, HasDensity<Double> {
|
public interface BetaDistribution extends ContinuousDistribution {
|
||||||
/**
|
|
||||||
* Modify the shape parameter, alpha.
|
|
||||||
* @param alpha the new shape parameter.
|
|
||||||
* @deprecated as of 2.1
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
void setAlpha(double alpha);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Access the shape parameter, alpha
|
* Access the alpha shape parameter.
|
||||||
|
*
|
||||||
* @return alpha.
|
* @return alpha.
|
||||||
*/
|
*/
|
||||||
double getAlpha();
|
double getAlpha();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modify the shape parameter, beta.
|
* Access the beta shape parameter.
|
||||||
* @param beta the new scale parameter.
|
*
|
||||||
* @deprecated as of 2.1
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
void setBeta(double beta);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Access the shape parameter, beta
|
|
||||||
* @return beta.
|
* @return beta.
|
||||||
*/
|
*/
|
||||||
double getBeta();
|
double getBeta();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the probability density for a particular point.
|
* Return the probability density for a particular point.
|
||||||
* @param x The point at which the density should be computed.
|
*
|
||||||
* @return The pdf at point x.
|
* @param x Point at which the density should be computed.
|
||||||
* @exception MathException if probability density cannot be computed
|
* @return the pdf at point {@code x}.
|
||||||
*/
|
*/
|
||||||
double density(Double x) throws MathException;
|
double density(double x);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
package org.apache.commons.math.distribution;
|
package org.apache.commons.math.distribution;
|
||||||
|
|
||||||
import org.apache.commons.math.MathException;
|
import org.apache.commons.math.MathException;
|
||||||
import org.apache.commons.math.MathRuntimeException;
|
import org.apache.commons.math.exception.NumberIsTooSmallException;
|
||||||
import org.apache.commons.math.exception.util.LocalizedFormats;
|
import org.apache.commons.math.exception.util.LocalizedFormats;
|
||||||
import org.apache.commons.math.special.Gamma;
|
import org.apache.commons.math.special.Gamma;
|
||||||
import org.apache.commons.math.special.Beta;
|
import org.apache.commons.math.special.Beta;
|
||||||
|
@ -63,10 +63,12 @@ public class BetaDistributionImpl
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build a new instance.
|
* Build a new instance.
|
||||||
* @param alpha first shape parameter (must be positive)
|
*
|
||||||
* @param beta second shape parameter (must be positive)
|
* @param alpha First shape parameter (must be positive).
|
||||||
* @param inverseCumAccuracy the maximum absolute error in inverse cumulative probability estimates
|
* @param beta Second shape parameter (must be positive).
|
||||||
* (defaults to {@link #DEFAULT_INVERSE_ABSOLUTE_ACCURACY})
|
* @param inverseCumAccuracy Maximum absolute error in inverse
|
||||||
|
* cumulative probability estimates (defaults to
|
||||||
|
* {@link #DEFAULT_INVERSE_ABSOLUTE_ACCURACY}).
|
||||||
* @since 2.1
|
* @since 2.1
|
||||||
*/
|
*/
|
||||||
public BetaDistributionImpl(double alpha, double beta, double inverseCumAccuracy) {
|
public BetaDistributionImpl(double alpha, double beta, double inverseCumAccuracy) {
|
||||||
|
@ -78,36 +80,19 @@ public class BetaDistributionImpl
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build a new instance.
|
* Build a new instance.
|
||||||
* @param alpha first shape parameter (must be positive)
|
*
|
||||||
* @param beta second shape parameter (must be positive)
|
* @param alpha First shape parameter (must be positive).
|
||||||
|
* @param beta Second shape parameter (must be positive).
|
||||||
*/
|
*/
|
||||||
public BetaDistributionImpl(double alpha, double beta) {
|
public BetaDistributionImpl(double alpha, double beta) {
|
||||||
this(alpha, beta, DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
|
this(alpha, beta, DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc}
|
|
||||||
* @deprecated as of 2.1 (class will become immutable in 3.0)
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public void setAlpha(double alpha) {
|
|
||||||
this.alpha = alpha;
|
|
||||||
z = Double.NaN;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
public double getAlpha() {
|
public double getAlpha() {
|
||||||
return alpha;
|
return alpha;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc}
|
|
||||||
* @deprecated as of 2.1 (class will become immutable in 3.0)
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public void setBeta(double beta) {
|
|
||||||
this.beta = beta;
|
|
||||||
z = Double.NaN;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
public double getBeta() {
|
public double getBeta() {
|
||||||
return beta;
|
return beta;
|
||||||
|
@ -125,19 +110,8 @@ public class BetaDistributionImpl
|
||||||
/**
|
/**
|
||||||
* Return the probability density for a particular point.
|
* Return the probability density for a particular point.
|
||||||
*
|
*
|
||||||
* @param x The point at which the density should be computed.
|
* @param x Point at which the density should be computed.
|
||||||
* @return The pdf at point x.
|
* @return the pdf at point x.
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
public double density(Double x) {
|
|
||||||
return density(x.doubleValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the probability density for a particular point.
|
|
||||||
*
|
|
||||||
* @param x The point at which the density should be computed.
|
|
||||||
* @return The pdf at point x.
|
|
||||||
* @since 2.1
|
* @since 2.1
|
||||||
*/
|
*/
|
||||||
public double density(double x) {
|
public double density(double x) {
|
||||||
|
@ -146,14 +120,12 @@ public class BetaDistributionImpl
|
||||||
return 0;
|
return 0;
|
||||||
} else if (x == 0) {
|
} else if (x == 0) {
|
||||||
if (alpha < 1) {
|
if (alpha < 1) {
|
||||||
throw MathRuntimeException.createIllegalArgumentException(
|
throw new NumberIsTooSmallException(LocalizedFormats.CANNOT_COMPUTE_BETA_DENSITY_AT_0_FOR_SOME_ALPHA, alpha, 1, false);
|
||||||
LocalizedFormats.CANNOT_COMPUTE_BETA_DENSITY_AT_0_FOR_SOME_ALPHA, alpha);
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
} else if (x == 1) {
|
} else if (x == 1) {
|
||||||
if (beta < 1) {
|
if (beta < 1) {
|
||||||
throw MathRuntimeException.createIllegalArgumentException(
|
throw new NumberIsTooSmallException(LocalizedFormats.CANNOT_COMPUTE_BETA_DENSITY_AT_1_FOR_SOME_BETA, beta, 1, false);
|
||||||
LocalizedFormats.CANNOT_COMPUTE_BETA_DENSITY_AT_1_FOR_SOME_BETA, beta);
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -214,7 +186,7 @@ public class BetaDistributionImpl
|
||||||
* Return the absolute accuracy setting of the solver used to estimate
|
* Return the absolute accuracy setting of the solver used to estimate
|
||||||
* inverse cumulative probabilities.
|
* inverse cumulative probabilities.
|
||||||
*
|
*
|
||||||
* @return the solver absolute accuracy
|
* @return the solver absolute accuracy.
|
||||||
* @since 2.1
|
* @since 2.1
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue