public abstract class AbstractDistributionApproximation extends java.lang.Object implements DistributionApproximation
Modifier and Type | Field and Description |
---|---|
protected double |
max |
protected double |
min |
protected org.apache.commons.math3.distribution.NormalDistribution |
normal |
protected int |
numberOfPoints |
protected double[] |
points |
protected double |
range |
protected double |
step |
protected double[] |
weights |
Constructor and Description |
---|
AbstractDistributionApproximation() |
Modifier and Type | Method and Description |
---|---|
double[] |
evaluate()
Gets and array of density values.
|
double |
getDensityAt(int index)
Gets a density value at the specified index of the array.
|
double |
getMaximum() |
double |
getMean() |
double |
getMinimum() |
int |
getNumberOfPoints()
Gets the number of evaluation points (and corresponding number of density values).
|
double |
getPointAt(int index)
Gets an evaluation points at the specified index of the array.
|
double[] |
getPoints()
Gets an array of evaluation points.
|
double |
getStandardDeviation() |
double |
getVariance() |
void |
setNormalPointsAndWeights(double mean,
double sd) |
void |
setUniformPointsAndWeights() |
double[] |
standardize(boolean keepPoints)
Uses current quadrature points and weights to compute the mean and standard deviation of the
density, and then standardizes the distribution to have a mean of zero and a standard deviation of one.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setDensityAt, setPointAt
protected int numberOfPoints
protected double min
protected double max
protected double range
protected double step
protected double[] points
protected double[] weights
protected org.apache.commons.math3.distribution.NormalDistribution normal
public void setNormalPointsAndWeights(double mean, double sd)
public void setUniformPointsAndWeights()
public double[] getPoints()
DistributionApproximation
getPoints
in interface DistributionApproximation
public double[] evaluate()
DistributionApproximation
evaluate
in interface DistributionApproximation
public double getPointAt(int index)
getPointAt
in interface DistributionApproximation
index
- array index of evaluation point.public double getDensityAt(int index)
getDensityAt
in interface DistributionApproximation
index
- array index of density value.public double getMinimum()
getMinimum
in interface DistributionApproximation
public double getMaximum()
getMaximum
in interface DistributionApproximation
public double getMean()
getMean
in interface DistributionApproximation
public double getVariance()
public double getStandardDeviation()
getStandardDeviation
in interface DistributionApproximation
public double[] standardize(boolean keepPoints)
standardize
in interface DistributionApproximation
keepPoints
- if true original points are retained and weights are computed at these points using
linear interpolation of the empirical cumulative distribution. If false, original weights
are retained and standardization is achieved by linearly transforming the original points.public int getNumberOfPoints()
getNumberOfPoints
in interface DistributionApproximation