public abstract class ProbabilityDistribution extends Object implements Serializable, Cloneable
Modifier | Constructor and Description |
---|---|
protected |
ProbabilityDistribution(int numberOfParameters)
Constructor for the probability distribution
|
Modifier and Type | Method and Description |
---|---|
int |
getNumberOfParameters()
Returns the number of parameters of the probability distribution.
|
abstract double[] |
getParameterLowerBounds()
Returns the lower bounds of the parameters.
|
abstract double[] |
getParameterUpperBounds()
Returns the upper bounds of the parameters.
|
double[] |
getPDFGradientApproximation(double x,
double... params)
Returns the approximate gradient of the probability density function,
pdf . |
double[][] |
getPDFHessianApproximation(double x,
double... params)
Returns the approximate hessian of the probability density function,
pdf . |
double[] |
getRangeOfX()
Returns the proper range of the random variable having the current
probability distribution.
|
abstract double |
pdf(double x,
double... params)
Returns the value of the probability density function.
|
void |
setRangeOfX(double[] range)
Sets the proper range of the random variable having the current
probability distribution.
|
protected ProbabilityDistribution(int numberOfParameters)
numberOfParameters
- an int
specifying the number of
parameters
Every subclass (specific probability distribution) must set the number of parameters.
public int getNumberOfParameters()
int
, the number of parameterspublic double[] getRangeOfX()
double
array containing the lower bound (at index
0) and upper bound (at index 1) for the random variable X
public void setRangeOfX(double[] range)
range
- a double
array containing the lower bound (at
index 0) and the upper bound (at index 1) for the random variable
Default: range[0]
=Double.NEGATIVE_INFINITY
and
range[1]
=Double.POSITIVE_INFINITY
.
public abstract double[] getParameterLowerBounds()
Each ProbabilityDistribution
subclass must override this
method.
double
array containing the lower bounds of the
parameterspublic abstract double[] getParameterUpperBounds()
Each ProbabilityDistribution
subclass must override this
method.
double
array containing the upper bounds of the
parameterspublic abstract double pdf(double x, double... params)
Each ProbabilityDistribution
subclass must override this
method.
x
- a double
valueparams
- a double
array or a comma-separated list of
doubles giving the values for the parameters
Note: The argument params
is a variable length argument
list (varargs).
double
value equal to the probability density
function given the parameters evaluated at X=x
public double[] getPDFGradientApproximation(double x, double... params)
pdf
.x
- a double
valueparams
- a double
array or a comma-separated list of
doubles giving the values for the parameters
Note: The argument params
is a variable length argument
list (varargs).
double
array containing the gradient approximation
given the parameter values and evaluated at X=x
public double[][] getPDFHessianApproximation(double x, double... params)
pdf
.x
- a double
valueparams
- a double
array or a comma-separated list of
doubles giving the values for the parameters
Note: The argument params
is a variable length argument
list (varargs).
double
matrix equal to the second partial
derivatives of the probability density function with respect to the
parameters evaluated at X=x
Copyright © 2020 Rogue Wave Software. All rights reserved.