SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.probdist.TruncatedDist Class Reference

This container class takes an arbitrary continuous distribution and truncates it to an interval \([a,b]\), where \(a\) and \(b\) can be finite or infinite. More...

Inheritance diagram for umontreal.ssj.probdist.TruncatedDist:
umontreal.ssj.probdist.ContinuousDistribution umontreal.ssj.probdist.Distribution

Public Member Functions

 TruncatedDist (ContinuousDistribution dist, double a, double b)
 Constructs a new distribution by truncating distribution dist to the interval \([a,b]\).
double density (double x)
 Returns \(f(x)\), the density evaluated at \(x\).
double cdf (double x)
 Returns the distribution function \(F(x)\).
double barF (double x)
 Returns the complementary distribution function.
double inverseF (double u)
 Returns the inverse distribution function \(x = F^{-1}(u)\).
double getMean ()
 Returns an approximation of the mean computed with the Simpson.
double getVariance ()
 Returns an approximation of the variance computed with the Simpson.
double getStandardDeviation ()
 Returns the square root of the approximate variance.
double getA ()
 Returns the value of \(a\).
double getB ()
 Returns the value of \(b\).
double getFa ()
 Returns the value of \(F_0(a)\).
double getFb ()
 Returns the value of \(F_0(b)\).
double getArea ()
 Returns the value of \(F_0(b) - F_0(a)\), the area under the truncated density function.
void setParams (ContinuousDistribution dist, double a, double b)
 Sets the parameters dist, \(a\) and \(b\) for this object.
double[] getParams ()
 Return a table containing the parameters of the current distribution.
String toString ()
 Returns a String containing information about the current distribution.
Public Member Functions inherited from umontreal.ssj.probdist.ContinuousDistribution
double inverseBrent (double a, double b, double u, double tol)
 Computes the inverse distribution function \(x = F^{-1}(u)\), using the Brent-Dekker method.
double inverseBisection (double u)
 Computes and returns the inverse distribution function \(x = F^{-1}(u)\), using bisection.
double getXinf ()
 Returns \(x_a\) such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\).
double getXsup ()
 Returns \(x_b\) such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\).
void setXinf (double xa)
 Sets the value \(x_a=\) xa, such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\).
void setXsup (double xb)
 Sets the value \(x_b=\) xb, such that the probability density is 0 everywhere outside the interval \([x_a, x_b]\).

Detailed Description

This container class takes an arbitrary continuous distribution and truncates it to an interval \([a,b]\), where \(a\) and \(b\) can be finite or infinite.

If the original density and distribution function are

\(f_0\) and \(F_0\), the new ones are \(f\) and \(F\), defined by

\[ f(x) = \frac{f_0(x)}{F_0(b) - F_0(a)} \qquad\mbox{ for } a\le x\le b \]

and \(f(x)=0\) elsewhere, and

\[ F(x) = \frac{F_0(x)-F_0(a)}{F_0(b)-F_0(a)} \qquad\mbox{ for } a\le x\le b. \]

The inverse distribution function of the truncated distribution is

\[ {F^{-1}}(u) = F_0^{-1}(F_0(a) + (F_0(b) - F_0(a))u) \]

where \(F_0^{-1}\) is the inverse distribution function of the original distribution.

Definition at line 48 of file TruncatedDist.java.

Constructor & Destructor Documentation

◆ TruncatedDist()

umontreal.ssj.probdist.TruncatedDist.TruncatedDist ( ContinuousDistribution dist,
double a,
double b )

Constructs a new distribution by truncating distribution dist to the interval \([a,b]\).

Restrictions: \(a\) and \(b\) must be finite.

Definition at line 66 of file TruncatedDist.java.

Member Function Documentation

◆ barF()

double umontreal.ssj.probdist.TruncatedDist.barF ( double x)

Returns the complementary distribution function.

The default implementation computes \(\bar{F}(x) = 1 - F(x)\).

Parameters
xvalue at which the complementary distribution function is evaluated
Returns
complementary distribution function evaluated at x

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 85 of file TruncatedDist.java.

◆ cdf()

double umontreal.ssj.probdist.TruncatedDist.cdf ( double x)

Returns the distribution function \(F(x)\).

Parameters
xvalue at which the distribution function is evaluated
Returns
distribution function evaluated at x

Implements umontreal.ssj.probdist.Distribution.

Definition at line 76 of file TruncatedDist.java.

◆ density()

double umontreal.ssj.probdist.TruncatedDist.density ( double x)

Returns \(f(x)\), the density evaluated at \(x\).

Parameters
xvalue at which the density is evaluated
Returns
density function evaluated at x

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 70 of file TruncatedDist.java.

◆ getA()

double umontreal.ssj.probdist.TruncatedDist.getA ( )

Returns the value of \(a\).

Definition at line 143 of file TruncatedDist.java.

◆ getArea()

double umontreal.ssj.probdist.TruncatedDist.getArea ( )

Returns the value of \(F_0(b) - F_0(a)\), the area under the truncated density function.

Definition at line 172 of file TruncatedDist.java.

◆ getB()

double umontreal.ssj.probdist.TruncatedDist.getB ( )

Returns the value of \(b\).

Definition at line 150 of file TruncatedDist.java.

◆ getFa()

double umontreal.ssj.probdist.TruncatedDist.getFa ( )

Returns the value of \(F_0(a)\).

Definition at line 157 of file TruncatedDist.java.

◆ getFb()

double umontreal.ssj.probdist.TruncatedDist.getFb ( )

Returns the value of \(F_0(b)\).

Definition at line 164 of file TruncatedDist.java.

◆ getMean()

double umontreal.ssj.probdist.TruncatedDist.getMean ( )

Returns an approximation of the mean computed with the Simpson.

\(1/3\) numerical integration rule.

Exceptions
UnsupportedOperationExceptionthe mean of the truncated distribution is unknown

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 109 of file TruncatedDist.java.

◆ getParams()

double[] umontreal.ssj.probdist.TruncatedDist.getParams ( )

Return a table containing the parameters of the current distribution.

This table is put in order: [ \(a\), \(b\), \(F_0(a)\), \(F_0(b)\), \(F_0(b) - F_0(a)\)].

Implements umontreal.ssj.probdist.Distribution.

Definition at line 219 of file TruncatedDist.java.

◆ getStandardDeviation()

double umontreal.ssj.probdist.TruncatedDist.getStandardDeviation ( )

Returns the square root of the approximate variance.

Exceptions
UnsupportedOperationExceptionthe mean of the truncated distribution is unknown

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 134 of file TruncatedDist.java.

◆ getVariance()

double umontreal.ssj.probdist.TruncatedDist.getVariance ( )

Returns an approximation of the variance computed with the Simpson.

\(1/3\) numerical integration rule.

Exceptions
UnsupportedOperationExceptionthe mean of the truncated distribution is unknown

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 122 of file TruncatedDist.java.

◆ inverseF()

double umontreal.ssj.probdist.TruncatedDist.inverseF ( double u)

Returns the inverse distribution function \(x = F^{-1}(u)\).

Restrictions: \(u \in[0,1]\).

Parameters
uvalue at which the inverse distribution function is evaluated
Returns
the inverse distribution function evaluated at u
Exceptions
IllegalArgumentExceptionif \(u\) is not in the interval \([0,1]\)

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 94 of file TruncatedDist.java.

◆ setParams()

void umontreal.ssj.probdist.TruncatedDist.setParams ( ContinuousDistribution dist,
double a,
double b )

Sets the parameters dist, \(a\) and \(b\) for this object.

See the constructor for details.

Definition at line 180 of file TruncatedDist.java.

◆ toString()

String umontreal.ssj.probdist.TruncatedDist.toString ( )

Returns a String containing information about the current distribution.

Definition at line 227 of file TruncatedDist.java.


The documentation for this class was generated from the following file: