public class TruncatedDist extends ContinuousDistribution
| Modifier and Type | Field and Description |
|---|---|
static int |
NUMINTERVALS |
decPrec| Constructor and Description |
|---|
TruncatedDist(ContinuousDistribution dist,
double a,
double b)
Constructs a new distribution by truncating distribution dist
to the interval [a, b].
|
| Modifier and Type | Method and Description |
|---|---|
double |
barF(double x)
Returns the complementary distribution function.
|
double |
cdf(double x)
Returns the distribution function F(x).
|
double |
density(double x)
Returns an approximation of the mean obtained using the
Simpson 1/3 numerical integration, or throws an
UnsupportedOperationException if a or b are infinite. |
double |
getA()
Returns the value of a.
|
double |
getArea()
Returns the value of
F(b) - F(a),
the area under the truncated density function.
|
double |
getB()
Returns the value of b.
|
double |
getFa()
Returns the value of F(a).
|
double |
getFb()
Returns the value of F(b).
|
double |
getMean()
Returns the mean.
|
double[] |
getParams()
Return a table containing the parameters of the current distribution.
|
double |
getStandardDeviation()
Returns the standard deviation.
|
double |
getVariance()
Returns an approximation of the variance obtained using the
Simpson 1/3 numerical integration, or throws an
UnsupportedOperationException if a or b are infinite. |
double |
inverseF(double u)
Returns the inverse distribution function
x = F-1(u).
|
void |
setParams(ContinuousDistribution dist,
double a,
double b)
Sets the parameters dist, a and b for this object.
|
java.lang.String |
toString()
Returns a String containing information about the current distribution.
|
getXinf, getXsup, inverseBisection, inverseBrent, setXinf, setXsuppublic TruncatedDist(ContinuousDistribution dist, double a, double b)
public double density(double x)
UnsupportedOperationException if a or b are infinite.density in class ContinuousDistributionx - value at which the density is evaluatedjava.lang.UnsupportedOperationException - the mean of the truncated distribution is unknownpublic double cdf(double x)
Distributionx - value at which the distribution function is evaluatedpublic double barF(double x)
ContinuousDistributionbarF in interface DistributionbarF in class ContinuousDistributionx - value at which the complementary distribution function is evaluatedpublic double inverseF(double u)
ContinuousDistributioninverseF in interface DistributioninverseF in class ContinuousDistributionu - value at which the inverse distribution function is evaluatedpublic double getMean()
ContinuousDistributiongetMean in interface DistributiongetMean in class ContinuousDistributionpublic double getVariance()
UnsupportedOperationException if a or b are infinite.getVariance in interface DistributiongetVariance in class ContinuousDistributionjava.lang.UnsupportedOperationException - the mean of the truncated distribution is unknownpublic double getStandardDeviation()
ContinuousDistributiongetStandardDeviation in interface DistributiongetStandardDeviation in class ContinuousDistributionpublic double getA()
public double getB()
public double getFa()
public double getFb()
public double getArea()
public void setParams(ContinuousDistribution dist, double a, double b)
public double[] getParams()
public java.lang.String toString()
toString in class java.lang.ObjectTo submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.