Package com.imsl.stat.distributions
Class NormalPD
java.lang.Object
com.imsl.stat.distributions.ProbabilityDistribution
com.imsl.stat.distributions.NormalPD
- All Implemented Interfaces:
ClosedFormMaximumLikelihoodInterface,PDFGradientInterface,PDFHessianInterface,Serializable,Cloneable
public class NormalPD
extends ProbabilityDistribution
implements PDFHessianInterface, ClosedFormMaximumLikelihoodInterface, Serializable, Cloneable
The normal (Gaussian) probability distribution.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble[]getClosedFormMLE(double[] x) Returns the closed form maximum likelihood estimates.double[]getClosedFormMlStandardError(double[] x) Returns the standard errors of the closed form maximum likelihood estimates.double[]getMLEs(double[] x) Deprecated.double[]Returns the lower bounds of the parameters.double[]Returns the upper bounds of the parameters.double[]getPDFGradient(double x, double... params) Returns the analytic gradient of the pdf.double[][]getPDFHessian(double x, double... params) Returns the analytic Hessian matrix of the pdf.doublepdf(double x, double... params) Returns the value of the normal probability density function.Methods inherited from class com.imsl.stat.distributions.ProbabilityDistribution
getNumberOfParameters, getPDFGradientApproximation, getPDFHessianApproximation, getRangeOfX, setRangeOfX
-
Constructor Details
-
NormalPD
public NormalPD()Constructor for the normal probability distribution.
-
-
Method Details
-
getParameterLowerBounds
public double[] getParameterLowerBounds()Returns the lower bounds of the parameters.- Specified by:
getParameterLowerBoundsin classProbabilityDistribution- Returns:
- a
doublearray containing the lower bounds for \(\mu\in\mathbb{R}\) and \(\sigma\gt0\)
-
getParameterUpperBounds
public double[] getParameterUpperBounds()Returns the upper bounds of the parameters.- Specified by:
getParameterUpperBoundsin classProbabilityDistribution- Returns:
- a
doublearray containing the upper bounds for \(\mu\in\mathbb{R}\) and \(\sigma\gt0\)
-
pdf
public double pdf(double x, double... params) Returns the value of the normal probability density function.The probability density function for a normal distribution is given by $$f(x; \mu,\sigma) = \frac{1}{\sqrt{2\pi}\sigma} {\exp}^{ -\frac{{(x - \mu)}^2}{{2 {\sigma}^2}} } $$ where \(\mu\) and \(\sigma >0\) are the mean and standard deviation of the random variable.
- Specified by:
pdfin classProbabilityDistribution- Parameters:
x- adouble, the value (quantile) at which to evaluate the pdfparams- adoublearray containing values of the parameters,\(\mu\) and \(\sigma\). The parameters can also be given in the formpdf(x,a,b), wherea=\(\mu\) andb=\(\sigma\) are scalars.- Returns:
- a
double, the probability density atxgiven the parameter values
-
getPDFGradient
public double[] getPDFGradient(double x, double... params) Returns the analytic gradient of the pdf.- Specified by:
getPDFGradientin interfacePDFGradientInterface- Parameters:
x- adouble, the value at which to evaluate the gradientparams- adoublearray containing the parameters- Returns:
- a
doublearray containing the partial derivatives of the pdf with respect to the parameters
-
getPDFHessian
public double[][] getPDFHessian(double x, double... params) Returns the analytic Hessian matrix of the pdf.- Specified by:
getPDFHessianin interfacePDFHessianInterface- Parameters:
x- adouble, the value at which to evaluate the Hessianparams- adoublearray containing the parameters- Returns:
- a
doublematrix containing the second partial derivatives of the pdf with respect to the parameters
-
getClosedFormMLE
public double[] getClosedFormMLE(double[] x) Returns the closed form maximum likelihood estimates.- Specified by:
getClosedFormMLEin interfaceClosedFormMaximumLikelihoodInterface- Parameters:
x- adoublearray containing the data- Returns:
- a
doublearray containing the maximum likelihood estimates for \(\mu\) and \(\sigma\)
-
getMLEs
public double[] getMLEs(double[] x) Deprecated.UsegetClosedFormMLE(double[])instead.Returns the mean and standard deviation of the sample data.These are the maximum likelihood estimates for the mean and standard deviation of the Normal distribution, given the data.
- Parameters:
x- adoublearray containing the data- Returns:
- a
doublearray containing the mean and standard deviation
-
getClosedFormMlStandardError
public double[] getClosedFormMlStandardError(double[] x) Returns the standard errors of the closed form maximum likelihood estimates.- Specified by:
getClosedFormMlStandardErrorin interfaceClosedFormMaximumLikelihoodInterface- Parameters:
x- adoublearray containing the data- Returns:
- a
doublearray containing the standard errors for the estimates of \(\mu,\sigma\)
-
getClosedFormMLE(double[])instead.