Package com.imsl.stat.distributions
Class ProbabilityDistribution
java.lang.Object
com.imsl.stat.distributions.ProbabilityDistribution
- All Implemented Interfaces:
Serializable,Cloneable
- Direct Known Subclasses:
BetaPD,BinomialPD,ContinuousUniformPD,DiscreteUniformPD,ExponentialPD,ExtremeValuePD,GammaPD,GeneralizedGaussianPD,GeometricPD,InverseGaussianPD,LogisticPD,LogLogisticPD,LogNormalPD,NegativeBinomialPD,NormalPD,ParetoPD,PoissonPD,RayleighPD,WeibullPD
The ProbabilityDistribution abstract class defines members and methods common
to univariate probability distributions and useful in parameter estimation.
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProbabilityDistribution(int numberOfParameters) Constructor for the probability distribution -
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of parameters of the probability distribution.abstract double[]Returns the lower bounds of the parameters.abstract double[]Returns the upper bounds of the parameters.double[]getPDFGradientApproximation(double x, double... params) Returns the approximate gradient of the probability density function,pdf.double[][]getPDFHessianApproximation(double x, double... params) Returns the approximate hessian of the probability density function,pdf.double[]Returns the proper range of the random variable having the current probability distribution.abstract doublepdf(double x, double... params) Returns the value of the probability density function.voidsetRangeOfX(double[] range) Sets the proper range of the random variable having the current probability distribution.
-
Constructor Details
-
ProbabilityDistribution
protected ProbabilityDistribution(int numberOfParameters) Constructor for the probability distribution- Parameters:
numberOfParameters- anintspecifying the number of parametersEvery subclass (specific probability distribution) must set the number of parameters.
-
-
Method Details
-
getNumberOfParameters
public int getNumberOfParameters()Returns the number of parameters of the probability distribution.- Returns:
- an
int, the number of parameters
-
getRangeOfX
public double[] getRangeOfX()Returns the proper range of the random variable having the current probability distribution.- Returns:
- a
doublearray containing the lower bound (at index 0) and upper bound (at index 1) for the random variableX
-
setRangeOfX
public void setRangeOfX(double[] range) Sets the proper range of the random variable having the current probability distribution.- Parameters:
range- adoublearray containing the lower bound (at index 0) and the upper bound (at index 1) for the random variableDefault:
range[0]=Double.NEGATIVE_INFINITYandrange[1]=Double.POSITIVE_INFINITY.
-
getParameterLowerBounds
public abstract double[] getParameterLowerBounds()Returns the lower bounds of the parameters.Each
ProbabilityDistributionsubclass must override this method.- Returns:
- a
doublearray containing the lower bounds of the parameters
-
getParameterUpperBounds
public abstract double[] getParameterUpperBounds()Returns the upper bounds of the parameters.Each
ProbabilityDistributionsubclass must override this method.- Returns:
- a
doublearray containing the upper bounds of the parameters
-
pdf
public abstract double pdf(double x, double... params) Returns the value of the probability density function.Each
ProbabilityDistributionsubclass must override this method.- Parameters:
x- adoublevalueparams- adoublearray or a comma-separated list of doubles giving the values for the parametersNote: The argument
paramsis a variable length argument list (varargs).- Returns:
- a
doublevalue equal to the probability density function given the parameters evaluated at X=x
-
getPDFGradientApproximation
public double[] getPDFGradientApproximation(double x, double... params) Returns the approximate gradient of the probability density function,pdf.- Parameters:
x- adoublevalueparams- adoublearray or a comma-separated list of doubles giving the values for the parametersNote: The argument
paramsis a variable length argument list (varargs).- Returns:
- a
doublearray containing the gradient approximation given the parameter values and evaluated at X=x
-
getPDFHessianApproximation
public double[][] getPDFHessianApproximation(double x, double... params) Returns the approximate hessian of the probability density function,pdf.- Parameters:
x- adoublevalueparams- adoublearray or a comma-separated list of doubles giving the values for the parametersNote: The argument
paramsis a variable length argument list (varargs).- Returns:
- a
doublematrix equal to the second partial derivatives of the probability density function with respect to the parameters evaluated at X=x
-