Package com.imsl.stat.distributions
Class ContinuousUniformPD
java.lang.Object
com.imsl.stat.distributions.ProbabilityDistribution
com.imsl.stat.distributions.ContinuousUniformPD
- All Implemented Interfaces:
ClosedFormMaximumLikelihoodInterface,com.imsl.stat.distributions.MethodOfMomentsInterface,PDFGradientInterface,PDFHessianInterface,Serializable,Cloneable
public class ContinuousUniformPD
extends ProbabilityDistribution
implements Serializable, Cloneable, PDFHessianInterface, ClosedFormMaximumLikelihoodInterface, com.imsl.stat.distributions.MethodOfMomentsInterface
The continuous uniform probability distribution.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a continuous uniform probability distribution. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]getClosedFormMLE(double[] x) Returns the closed form maximum likelihood estimates.double[]getClosedFormMlStandardError(double[] x) Returns the standard error based on the closed form maximum likelihood estimates.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 of the pdf.doublepdf(double x, double... params) Returns the value of the continuous uniform probability density function.Methods inherited from class com.imsl.stat.distributions.ProbabilityDistribution
getNumberOfParameters, getPDFGradientApproximation, getPDFHessianApproximation, getRangeOfX, setRangeOfX
-
Constructor Details
-
ContinuousUniformPD
public ContinuousUniformPD()Constructs a continuous uniform probability distribution.
-
-
Method Details
-
getParameterLowerBounds
public double[] getParameterLowerBounds()Returns the lower bounds of the parameters.- Specified by:
getParameterLowerBoundsin classProbabilityDistribution- Returns:
- a
doublearray of length 2 containing the lower bounds (\( -\infty \lt a \lt b \lt \infty \))
-
getParameterUpperBounds
public double[] getParameterUpperBounds()Returns the upper bounds of the parameters.- Specified by:
getParameterUpperBoundsin classProbabilityDistribution- Returns:
- a
doublearray of length 2 containing the upper bounds (\( -\infty \lt a \lt b \lt \infty \))
-
pdf
public double pdf(double x, double... params) Returns the value of the continuous uniform probability density function.The probability density function of the continuous uniform distribution is $$f(x|a,b)=\left\{\begin{array}{lll}\frac{1}{b-a}, & \mbox{for} & a\le x\le b \\ 0, & \mbox{for} & x\lt a \; \mbox{or} \; x\gt b \end{array}\right. $$ where \( -\infty \lt a \lt b \lt \infty \).
- Specified by:
pdfin classProbabilityDistribution- Parameters:
x- adouble, the value (quantile) at which to evaluate the pdfparams- adoublearray containing the parametersaandb. The parameters can also be given in the formpdf(x,a,b), whereaandbare 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 gradient. The function is undefined whenx= a orx= b.params- adoublearray containing values of the parameters,aandb. The parameters can also be given in the formpdf(x,a,b), whereaandbare scalars.- Returns:
- a
doublearray containing the first partial derivative of the pdf given the parameters
-
getPDFHessian
public double[][] getPDFHessian(double x, double... params) Returns the analytic Hessian of the pdf.- Specified by:
getPDFHessianin interfacePDFHessianInterface- Parameters:
x- adouble,the value at which to evaluate the Hessian. The function is undefined whenx= a orx= b.params- adoublearray containing values of the parameters,aandb. The parameters can also be given in the formpdf(x,a,b), whereaandbare scalars.- Returns:
- a
doublematrix containing the second partial derivatives of pdf with respect to the parameters
-
getClosedFormMLE
public double[] getClosedFormMLE(double[] x) Returns the closed form maximum likelihood estimates.For the continuous uniform distribution, the maximum likelihood estimates are the minimum and maximum of the sample data.
- Specified by:
getClosedFormMLEin interfaceClosedFormMaximumLikelihoodInterface- Parameters:
x- adoublearray containing the data- Returns:
- a
doublearray containing the closed form estimates
-
getClosedFormMlStandardError
public double[] getClosedFormMlStandardError(double[] x) Returns the standard error based on the closed form maximum likelihood estimates.- Specified by:
getClosedFormMlStandardErrorin interfaceClosedFormMaximumLikelihoodInterface- Parameters:
x- adoublearray containing the data- Returns:
- a
doublearray containing the standard errors
-