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

Extends the class ContinuousDistribution for the folded normal distribution with parameters \(\mu\ge0\) and \(\sigma> 0\). More...

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

Public Member Functions

 FoldedNormalDist (double mu, double sigma)
 Constructs a FoldedNormalDist object with parameters \(\mu=\) mu and \(\sigma=\) sigma.
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 the mean.
double getVariance ()
 Returns the variance.
double getStandardDeviation ()
 Returns the standard deviation.
double getMu ()
 Returns the parameter \(\mu\) of this object.
double getSigma ()
 Returns the parameter \(\sigma\) of this object.
void setParams (double mu, double sigma)
 Sets the parameters \(\mu\) and \(\sigma\) 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]\).

Static Public Member Functions

static double density (double mu, double sigma, double x)
 Computes the density function of the folded normal distribution.
static double cdf (double mu, double sigma, double x)
 Computes the distribution function.
static double barF (double mu, double sigma, double x)
 Computes the complementary distribution function.
static double inverseF (double mu, double sigma, double u)
 Computes the inverse of the distribution function.
static double getMean (double mu, double sigma)
 Computes and returns the mean.
static double getVariance (double mu, double sigma)
 Computes and returns the variance.
static double getStandardDeviation (double mu, double sigma)
 Computes the standard deviation of the folded normal distribution with parameters \(\mu\) and \(\sigma\).
static double[] getMLE (double[] x, int n)
 NOT IMPLEMENTED.

Detailed Description

Extends the class ContinuousDistribution for the folded normal distribution with parameters \(\mu\ge0\) and \(\sigma> 0\).

The density is

\[ f(x) = \phi\left(\frac{x-\mu}{\sigma}\right) + \phi\left(\frac{-x-\mu}{\sigma}\right) \qquad\mbox{for } x \ge0, \tag{fFoldedNormal} \]

\[ f(x) = 0, \qquad\mbox{ for } x < 0, \]

where \( \phi\) denotes the density function of a standard normal distribution.

Definition at line 47 of file FoldedNormalDist.java.

Constructor & Destructor Documentation

◆ FoldedNormalDist()

umontreal.ssj.probdist.FoldedNormalDist.FoldedNormalDist ( double mu,
double sigma )

Constructs a FoldedNormalDist object with parameters \(\mu=\) mu and \(\sigma=\) sigma.

Definition at line 70 of file FoldedNormalDist.java.

Member Function Documentation

◆ barF() [1/2]

double umontreal.ssj.probdist.FoldedNormalDist.barF ( double mu,
double sigma,
double x )
static

Computes the complementary distribution function.

Parameters
muthe parameter mu
sigmathe parameter sigma
xthe value at which the complementary distribution is evaluated
Returns
returns the complementary distribution function

Definition at line 146 of file FoldedNormalDist.java.

◆ barF() [2/2]

double umontreal.ssj.probdist.FoldedNormalDist.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 82 of file FoldedNormalDist.java.

◆ cdf() [1/2]

double umontreal.ssj.probdist.FoldedNormalDist.cdf ( double mu,
double sigma,
double x )
static

Computes the distribution function.

Parameters
muthe parameter mu
sigmathe parameter sigma
xthe value at which the distribution is evaluated
Returns
returns the cdf function

Definition at line 128 of file FoldedNormalDist.java.

◆ cdf() [2/2]

double umontreal.ssj.probdist.FoldedNormalDist.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 78 of file FoldedNormalDist.java.

◆ density() [1/2]

double umontreal.ssj.probdist.FoldedNormalDist.density ( double mu,
double sigma,
double x )
static

Computes the density function of the folded normal distribution.

Parameters
muthe parameter mu
sigmathe parameter sigma
xthe value at which the density is evaluated
Returns
returns the density function

Definition at line 110 of file FoldedNormalDist.java.

◆ density() [2/2]

double umontreal.ssj.probdist.FoldedNormalDist.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 74 of file FoldedNormalDist.java.

◆ getMean() [1/2]

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

Returns the mean.

Returns
the mean

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 90 of file FoldedNormalDist.java.

◆ getMean() [2/2]

double umontreal.ssj.probdist.FoldedNormalDist.getMean ( double mu,
double sigma )
static

Computes and returns the mean.

\[ E[X] = \sigma\sqrt{\frac{2}{\pi}}\; e^{-\mu^2/(2\sigma^2)} + \mu \mbox{erf}\left(\frac{\mu}{\sigma\sqrt{2}}\right), \]

where erf \((z)\) is the error function.

Parameters
muthe parameter mu
sigmathe parameter sigma
Returns
returns the mean

Definition at line 190 of file FoldedNormalDist.java.

◆ getMLE()

double[] umontreal.ssj.probdist.FoldedNormalDist.getMLE ( double[] x,
int n )
static

NOT IMPLEMENTED.

Les formules pour le MLE sont données dans

[160] .

Parameters
xthe list of observations used to evaluate parameters
nthe number of observations used to evaluate parameters
Returns
returns the parameters [ \(\hat{\mu}\), \(\hat{\sigma}\)]

Definition at line 239 of file FoldedNormalDist.java.

◆ getMu()

double umontreal.ssj.probdist.FoldedNormalDist.getMu ( )

Returns the parameter \(\mu\) of this object.

Returns
returns the parameter mu

Definition at line 250 of file FoldedNormalDist.java.

◆ getParams()

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

Return a table containing the parameters of the current distribution.

This table is put in regular order: [ \(\mu\), \(\sigma\)].

Returns
returns the parameters [ \(\mu\), \(\sigma\)]

Implements umontreal.ssj.probdist.Distribution.

Definition at line 284 of file FoldedNormalDist.java.

◆ getSigma()

double umontreal.ssj.probdist.FoldedNormalDist.getSigma ( )

Returns the parameter \(\sigma\) of this object.

Returns
returns the parameter sigma

Definition at line 259 of file FoldedNormalDist.java.

◆ getStandardDeviation() [1/2]

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

Returns the standard deviation.

Returns
the standard deviation

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 98 of file FoldedNormalDist.java.

◆ getStandardDeviation() [2/2]

double umontreal.ssj.probdist.FoldedNormalDist.getStandardDeviation ( double mu,
double sigma )
static

Computes the standard deviation of the folded normal distribution with parameters \(\mu\) and \(\sigma\).

Parameters
muthe parameter mu
sigmathe parameter sigma
Returns
returns the standard deviation

Definition at line 226 of file FoldedNormalDist.java.

◆ getVariance() [1/2]

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

Returns the variance.

Returns
the variance

Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.

Definition at line 94 of file FoldedNormalDist.java.

◆ getVariance() [2/2]

double umontreal.ssj.probdist.FoldedNormalDist.getVariance ( double mu,
double sigma )
static

Computes and returns the variance.

\[ \mbox{Var}[X] = \mu^2 + \sigma^2 - E[X]^2. \]

Parameters
muthe parameter mu
sigmathe parameter sigma
Returns
returns the variance

Definition at line 208 of file FoldedNormalDist.java.

◆ inverseF() [1/2]

double umontreal.ssj.probdist.FoldedNormalDist.inverseF ( double mu,
double sigma,
double u )
static

Computes the inverse of the distribution function.

Parameters
muthe parameter mu
sigmathe parameter sigma
uthe value at which the inverse distribution is evaluated
Returns
returns the inverse distribution function

Definition at line 164 of file FoldedNormalDist.java.

◆ inverseF() [2/2]

double umontreal.ssj.probdist.FoldedNormalDist.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 86 of file FoldedNormalDist.java.

◆ setParams()

void umontreal.ssj.probdist.FoldedNormalDist.setParams ( double mu,
double sigma )

Sets the parameters \(\mu\) and \(\sigma\) for this object.

Parameters
muthe parameter mu
sigmathe parameter sigma

Definition at line 269 of file FoldedNormalDist.java.

◆ toString()

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

Returns a String containing information about the current distribution.

Returns
returns a String containing information about the current distribution.

Definition at line 295 of file FoldedNormalDist.java.


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