public class ContinuousUniformPD extends ProbabilityDistribution implements Serializable, Cloneable, PDFHessianInterface, ClosedFormMaximumLikelihoodInterface
Constructor and Description |
---|
ContinuousUniformPD()
Constructs a continuous uniform probability distribution.
|
Modifier and Type | Method and Description |
---|---|
double[] |
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[] |
getParameterLowerBounds()
Returns the lower bounds of the parameters.
|
double[] |
getParameterUpperBounds()
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.
|
double |
pdf(double x,
double... params)
Returns the value of the continuous uniform probability density function.
|
getNumberOfParameters, getPDFGradientApproximation, getPDFHessianApproximation, getRangeOfX, setRangeOfX
public ContinuousUniformPD()
public double[] getParameterLowerBounds()
getParameterLowerBounds
in class ProbabilityDistribution
double
array of length 2 containing the lower
bounds (\( -\infty \lt a \lt b \lt \infty \))public double[] getParameterUpperBounds()
getParameterUpperBounds
in class ProbabilityDistribution
double
array of length 2 containing the upper
bounds (\( -\infty \lt a \lt b \lt \infty \))public double pdf(double x, double... params)
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 \).
pdf
in class ProbabilityDistribution
x
- a double
, the value (quantile) at which to evaluate the pdfparams
- a double
array containing the parameters
a
and b
. The parameters can also be given in the form pdf(x,a,b)
,
where a
and b
are scalars.double
, the probability density at
x
given the parameter valuespublic double[] getPDFGradient(double x, double... params)
getPDFGradient
in interface PDFGradientInterface
x
- a double
, the value at which to evaluate the gradient.
The function is undefined when
x
= a or x
= b.params
- a double
array containing values of the
parameters, a
and b
.
The parameters can also be given in the form pdf(x,a,b)
,
where a
and b
are scalars.double
array containing the first partial
derivative of the pdf given the parameterspublic double[][] getPDFHessian(double x, double... params)
getPDFHessian
in interface PDFHessianInterface
x
- a double
,the value at which to evaluate the Hessian.
The function is undefined when
x
= a or x
= b.params
- a double
array containing values of the
parameters, a
and b
. The parameters can also be given
in the form pdf(x,a,b)
,
where a
and b
are scalars.double
matrix containing the second partial
derivatives of pdf with respect to the parameterspublic double[] getClosedFormMLE(double[] x)
For the continuous uniform distribution, the maximum likelihood estimates are the minimum and maximum of the sample data.
getClosedFormMLE
in interface ClosedFormMaximumLikelihoodInterface
x
- a double
array containing the datadouble
array containing the closed form estimatespublic double[] getClosedFormMlStandardError(double[] x)
getClosedFormMlStandardError
in interface ClosedFormMaximumLikelihoodInterface
x
- a double
array containing the datadouble
array containing the standard errorsCopyright © 2020 Rogue Wave Software. All rights reserved.