Package com.imsl.stat.distributions
Class GeometricPD
java.lang.Object
com.imsl.stat.distributions.ProbabilityDistribution
com.imsl.stat.distributions.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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble[]getClosedFormMLE(double[] x) Returns the maximum likelihood estimate for the parameter.double[]getClosedFormMlStandardError(double[] x) Returns the standard error of the maximum likelihood estimate.double[]getMethodOfMomentsEstimates(double[] x) Returns the method-of-moments estimates given the sample data.double[]Returns the lower bound of the parameter.double[]Returns the upper bound of the parameter.double[]getPDFGradient(double x, double... params) Returns the analytic gradient of the pdf evaluated atx.double[][]getPDFHessian(double x, double... params) Returns the analytic Hessian matrix evaluated atx.doublepdf(double x, double... params) Returns the value of the geometric probability density function.Methods inherited from class com.imsl.stat.distributions.ProbabilityDistribution
getNumberOfParameters, getPDFGradientApproximation, getPDFHessianApproximation, getRangeOfX, setRangeOfX
-
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:
getParameterLowerBoundsin classProbabilityDistribution- Returns:
- a
doublearray of length 1 containing the lower bound (0)
-
getParameterUpperBounds
public double[] getParameterUpperBounds()Returns the upper bound of the parameter.- Specified by:
getParameterUpperBoundsin classProbabilityDistribution- Returns:
- a
doublearray 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:
pdfin classProbabilityDistribution- Parameters:
x- adouble, the value (quantile) at which to evaluate the pdf.xmust be a non-negative integer. Ifxis not a whole number thefloor()value will be used.params- adouble, the probability of success- Returns:
- a
double, the probability density atxgiven the parameter value
-
getPDFGradient
public double[] getPDFGradient(double x, double... params) Returns the analytic gradient of the pdf evaluated atx.- Specified by:
getPDFGradientin interfacePDFGradientInterface- Parameters:
x- adoublevalue.xmust be a non-negative integer. Ifxis not a whole number thefloor()value will be used.params- adoublespecifying the probability of success- Returns:
- a
doublearray containing the first partial derivative of the parameters
-
getPDFHessian
public double[][] getPDFHessian(double x, double... params) Returns the analytic Hessian matrix evaluated atx.- Specified by:
getPDFHessianin interfacePDFHessianInterface- Parameters:
x- adoublevalue.xmust be a non-negative integer. Ifxis not a whole number thefloor()value will be used.params- adoublespecifying the probability of success- Returns:
- a
doublematrix containing the second partial derivatives of the parameters
-
getClosedFormMLE
public double[] getClosedFormMLE(double[] x) Returns the maximum likelihood estimate for the parameter.- Specified by:
getClosedFormMLEin interfaceClosedFormMaximumLikelihoodInterface- Parameters:
x- adoublearray containing the data- Returns:
- a
doublearray containing the maximum likelihood estimate(s)
-
getClosedFormMlStandardError
public double[] getClosedFormMlStandardError(double[] x) Returns the standard error of the maximum likelihood estimate.- Specified by:
getClosedFormMlStandardErrorin interfaceClosedFormMaximumLikelihoodInterface- Parameters:
x- adoublearray containing the data- Returns:
- a
doublearray containing the standard errors
-
getMethodOfMomentsEstimates
public double[] getMethodOfMomentsEstimates(double[] x) Returns the method-of-moments estimates given the sample data.- Specified by:
getMethodOfMomentsEstimatesin interfacecom.imsl.stat.distributions.MethodOfMomentsInterface- Parameters:
x- adoublearray containing the data- Returns:
- a
doublearray containing method-of-moments estimate(s)
-