Class GeometricPD

All Implemented Interfaces:
ClosedFormMaximumLikelihoodInterface, com.imsl.stat.distributions.MethodOfMomentsInterface, PDFGradientInterface, PDFHessianInterface, Serializable, Cloneable

public class GeometricPD extends ProbabilityDistribution implements Serializable, Cloneable, PDFHessianInterface, ClosedFormMaximumLikelihoodInterface, com.imsl.stat.distributions.MethodOfMomentsInterface
The geometric probability distribution.
See Also:
  • Constructor Details

    • GeometricPD

      public GeometricPD()
      Constructor for the geometric probability distribution.
  • Method Details

    • getParameterLowerBounds

      public double[] getParameterLowerBounds()
      Returns the lower bound of the parameter.
      Specified by:
      getParameterLowerBounds in class ProbabilityDistribution
      Returns:
      a double array of length 1 containing the lower bound (0)
    • getParameterUpperBounds

      public double[] getParameterUpperBounds()
      Returns the upper bound of the parameter.
      Specified by:
      getParameterUpperBounds in class ProbabilityDistribution
      Returns:
      a double array of length 1 containing the upper bound (1.0)
    • pdf

      public double pdf(double x, double... params)
      Returns the value of the geometric probability density function.

      Given the probability of success \(p\) for a sequence of independent and identical trials, the probability of \(X = k \in {0,1,2,\ldots }\) failures until the first success is given by \(Pr[X=k]=(1-p)^k p \). The discrete random variable \(X\) is a geometric random variable with parameter \(p\).

      Specified by:
      pdf in class ProbabilityDistribution
      Parameters:
      x - a double, the value (quantile) at which to evaluate the pdf. x must be a non-negative integer. If x is not a whole number the floor() value will be used.
      params - a double, the probability of success
      Returns:
      a double, the probability density at x given the parameter value
    • getPDFGradient

      public double[] getPDFGradient(double x, double... params)
      Returns the analytic gradient of the pdf evaluated at x.
      Specified by:
      getPDFGradient in interface PDFGradientInterface
      Parameters:
      x - a double value. x must be a non-negative integer. If x is not a whole number the floor() value will be used.
      params - a double specifying the probability of success
      Returns:
      a double array containing the first partial derivative of the parameters
    • getPDFHessian

      public double[][] getPDFHessian(double x, double... params)
      Returns the analytic Hessian matrix evaluated at x.
      Specified by:
      getPDFHessian in interface PDFHessianInterface
      Parameters:
      x - a double value. x must be a non-negative integer. If x is not a whole number the floor() value will be used.
      params - a double specifying the probability of success
      Returns:
      a double matrix containing the second partial derivatives of the parameters
    • getClosedFormMLE

      public double[] getClosedFormMLE(double[] x)
      Returns the maximum likelihood estimate for the parameter.
      Specified by:
      getClosedFormMLE in interface ClosedFormMaximumLikelihoodInterface
      Parameters:
      x - a double array containing the data
      Returns:
      a double array containing the maximum likelihood estimate(s)
    • getClosedFormMlStandardError

      public double[] getClosedFormMlStandardError(double[] x)
      Returns the standard error of the maximum likelihood estimate.
      Specified by:
      getClosedFormMlStandardError in interface ClosedFormMaximumLikelihoodInterface
      Parameters:
      x - a double array containing the data
      Returns:
      a double array containing the standard errors
    • getMethodOfMomentsEstimates

      public double[] getMethodOfMomentsEstimates(double[] x)
      Returns the method-of-moments estimates given the sample data.
      Specified by:
      getMethodOfMomentsEstimates in interface com.imsl.stat.distributions.MethodOfMomentsInterface
      Parameters:
      x - a double array containing the data
      Returns:
      a double array containing method-of-moments estimate(s)