JMSLTM Numerical Library 7.2.0
com.imsl.stat.distributions

## Class ProbabilityDistribution

• All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
BetaPD, GammaPD, NormalPD

```public abstract class ProbabilityDistribution
extends Object
implements Serializable, Cloneable```
The ProbabilityDistribution abstract class defines members and methods common to univariate probability distributions and useful in parameter estimation.
Serialized Form
• ### Constructor Summary

Constructors
Modifier Constructor and Description
`protected ` `ProbabilityDistribution(int numberOfParameters)`
Constructor for the probability distribution
• ### Method Summary

Methods
Modifier and Type Method and Description
`int` `getNumberOfParameters()`
Returns the number of parameters of the probability distribution.
`abstract double[]` `getParameterLowerBounds()`
Returns the lower bounds of the parameters.
`abstract double[]` `getParameterUpperBounds()`
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[]` `getRangeOfX()`
Returns the proper range of the random variable having the current probability distribution.
`abstract double` ```pdf(double x, double[] params)```
Returns the value of the probability density function.
`void` `setRangeOfX(double[] range)`
Sets the proper range of the random variable having the current probability distribution.
• ### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Constructor Detail

• #### ProbabilityDistribution

`protected ProbabilityDistribution(int numberOfParameters)`
Constructor for the probability distribution
Parameters:
`numberOfParameters` - an `int` specifying the number of parameters

Every subclass (specific probability distribution) must set the number of parameters.

• ### Method Detail

• #### getNumberOfParameters

`public int getNumberOfParameters()`
Returns the number of parameters of the probability distribution.
Returns:
an `int`, the number of parameters
• #### getParameterLowerBounds

`public abstract double[] getParameterLowerBounds()`
Returns the lower bounds of the parameters.

Each `ProbabilityDistribution` subclass must override this method.

Returns:
a `double` array containing the lower bounds of the parameters
• #### getParameterUpperBounds

`public abstract double[] getParameterUpperBounds()`
Returns the upper bounds of the parameters.

Each `ProbabilityDistribution` subclass must override this method.

Returns:
a `double` array containing the upper bounds of the parameters

```public double[] getPDFGradientApproximation(double x,
double[] params)```
Returns the approximate gradient of the probability density function, `pdf`.
Parameters:
`x` - a `double` value
`params` - a `double` array or a comma-separated list of doubles giving the values for the parameters

Note: The argument `params` is a variable length argument list (varargs).

Returns:
a `double` array 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` - a `double` value
`params` - a `double` array or a comma-separated list of doubles giving the values for the parameters

Note: The argument `params` is a variable length argument list (varargs).

Returns:
a `double` matrix equal to the second partial derivatives of the probability density function with respect to the parameters evaluated at X=`x`
• #### getRangeOfX

`public double[] getRangeOfX()`
Returns the proper range of the random variable having the current probability distribution.
Returns:
a `double` array containing the lower bound (at index 0) and upper bound (at index 1) for the random variable `X`
• #### pdf

```public abstract double pdf(double x,
double[] params)```
Returns the value of the probability density function.

Each `ProbabilityDistribution` subclass must override this method.

Parameters:
`x` - a `double` value
`params` - a `double` array or a comma-separated list of doubles giving the values for the parameters

Note: The argument `params` is a variable length argument list (varargs).

Returns:
a `double` value equal to the probability density function given the parameters evaluated at X=`x`
• #### setRangeOfX

`public void setRangeOfX(double[] range)`
Sets the proper range of the random variable having the current probability distribution.
Parameters:
`range` - a `double` array containing the lower bound (at index 0) and the upper bound (at index 1) for the random variable

Default: `range[0]`=`Double.NEGATIVE_INFINITY` and `range[1]`=`Double.POSITIVE_INFINITY`.

JMSLTM Numerical Library 7.2.0