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

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.
See Also:
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    int
    Returns 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 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 Details

    • 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 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 double array containing the lower bound (at index 0) and upper bound (at index 1) for the random variable 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.

    • 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
    • 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
    • getPDFGradientApproximation

      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