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, waitsetDensityAt, setPointAtprotected 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()
DistributionApproximationgetPoints in interface DistributionApproximationpublic double[] evaluate()
DistributionApproximationevaluate in interface DistributionApproximationpublic double getPointAt(int index)
getPointAt in interface DistributionApproximationindex - array index of evaluation point.public double getDensityAt(int index)
getDensityAt in interface DistributionApproximationindex - array index of density value.public double getMinimum()
getMinimum in interface DistributionApproximationpublic double getMaximum()
getMaximum in interface DistributionApproximationpublic double getMean()
getMean in interface DistributionApproximationpublic double getVariance()
public double getStandardDeviation()
getStandardDeviation in interface DistributionApproximationpublic double[] standardize(boolean keepPoints)
standardize in interface DistributionApproximationkeepPoints - 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