Extends the class ContinuousDistribution for the half-normal distribution with parameters \(\mu\) and \(\sigma> 0\). More...
Public Member Functions | |
| HalfNormalDist (double mu, double sigma) | |
| Constructs a HalfNormalDist 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\). | |
| 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 half-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[] | getMLE (double[] x, int n) |
| Estimates the parameters \(\mu\) and \(\sigma\) of the half-normal distribution using the maximum likelihood method from the \(n\) observations \(x[i]\), \(i = 0, 1, …, n-1\). | |
| static double[] | getMLE (double[] x, int n, double mu) |
| Estimates the parameter \(\sigma\) of the half-normal distribution using the maximum likelihood method from the \(n\) observations \(x[i]\), \(i
= 0, 1, …, n-1\) and the parameter. | |
| static double | getMean (double mu, double sigma) |
| Computes and returns the mean \( E[X] = \mu+ \sigma\sqrt{2 / \pi}. \). | |
| static double | getVariance (double mu, double sigma) |
| Computes and returns the variance \( \mbox{Var}[X] =
\left(1-2/\pi\right)\sigma^2. \). | |
| static double | getStandardDeviation (double mu, double sigma) |
| Computes the standard deviation of the half-normal distribution with parameters \(\mu\) and \(\sigma\). | |
Extends the class ContinuousDistribution for the half-normal distribution with parameters \(\mu\) and \(\sigma> 0\).
Its density is
\begin{align} f(x) & = \frac{1}{\sigma}\sqrt{\frac{2}{\pi}}\; e^{-(x-\mu)^2/2\sigma^2}, \qquad\mbox{for } x \ge\mu. \\ \tag{fHalfNormal} f(x) & = 0, \qquad\mbox{for } x < \mu. \nonumber \end{align}
Definition at line 43 of file HalfNormalDist.java.
| umontreal.ssj.probdist.HalfNormalDist.HalfNormalDist | ( | double | mu, |
| double | sigma ) |
Constructs a HalfNormalDist object with parameters \(\mu=\) mu and \(\sigma=\) sigma.
Definition at line 52 of file HalfNormalDist.java.
|
static |
Computes the complementary distribution function.
| mu | the parameter mu |
| sigma | the parameter sigma |
| x | the value at which the complementary distribution is evaluated |
Definition at line 129 of file HalfNormalDist.java.
| double umontreal.ssj.probdist.HalfNormalDist.barF | ( | double | x | ) |
Returns the complementary distribution function.
The default implementation computes \(\bar{F}(x) = 1 - F(x)\).
| x | value at which the complementary distribution function is evaluated |
Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.
Definition at line 67 of file HalfNormalDist.java.
|
static |
Computes the distribution function.
| mu | the parameter mu |
| sigma | the parameter sigma |
| x | the value at which the distribution is evaluated |
Definition at line 112 of file HalfNormalDist.java.
| double umontreal.ssj.probdist.HalfNormalDist.cdf | ( | double | x | ) |
Returns the distribution function \(F(x)\).
| x | value at which the distribution function is evaluated |
Implements umontreal.ssj.probdist.Distribution.
Definition at line 63 of file HalfNormalDist.java.
|
static |
Computes the density function of the half-normal distribution.
| mu | the parameter mu |
| sigma | the parameter sigma |
| x | the value at which the density is evaluated |
Definition at line 95 of file HalfNormalDist.java.
| double umontreal.ssj.probdist.HalfNormalDist.density | ( | double | x | ) |
Returns \(f(x)\), the density evaluated at \(x\).
| x | value at which the density is evaluated |
Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.
Definition at line 56 of file HalfNormalDist.java.
| double umontreal.ssj.probdist.HalfNormalDist.getMean | ( | ) |
Returns the mean.
Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.
Definition at line 75 of file HalfNormalDist.java.
|
static |
Computes and returns the mean \( E[X] = \mu+ \sigma\sqrt{2 / \pi}. \).
| mu | the parameter mu |
| sigma | the parameter sigma |
Definition at line 229 of file HalfNormalDist.java.
|
static |
Estimates the parameters \(\mu\) and \(\sigma\) of the half-normal distribution using the maximum likelihood method from the \(n\) observations \(x[i]\), \(i = 0, 1, …, n-1\).
The estimates are returned in a two-element array: [ \(\mu\), \(\sigma\)]. The maximum likelihood estimators are the values
\(\hat{\mu}\) and \(\hat{\sigma}\) that satisfy the equation
\begin{align*} \hat{\mu}= \min_j \{x_j\}, \\ \hat{\sigma}= \sqrt{\frac{1}{n}\Sigma_j(x_j-\hat{\mu})^2}. \end{align*}
| x | the list of observations to use to evaluate parameters |
| n | the number of observations to use to evaluate parameters |
Definition at line 175 of file HalfNormalDist.java.
|
static |
Estimates the parameter \(\sigma\) of the half-normal distribution using the maximum likelihood method from the \(n\) observations \(x[i]\), \(i = 0, 1, …, n-1\) and the parameter.
\(\mu\) = mu. The estimate is returned in a one-element array: [ \(\sigma\)]. The maximum likelihood estimator is the value \(\hat{\sigma}\) that satisfies the equation
\begin{align*} \hat{\sigma}= \sqrt{\frac{1}{n}\Sigma_j(x_j-\mu)^2}. \end{align*}
| x | the list of observations to use to evaluate parameters |
| n | the number of observations to use to evaluate parameter |
| mu | the parameter mu |
Definition at line 209 of file HalfNormalDist.java.
| double umontreal.ssj.probdist.HalfNormalDist.getMu | ( | ) |
Returns the parameter \(\mu\) of this object.
Definition at line 266 of file HalfNormalDist.java.
| double[] umontreal.ssj.probdist.HalfNormalDist.getParams | ( | ) |
Return a table containing the parameters of the current distribution.
This table is put in regular order: [ \(\mu\), \(\sigma\)].
Implements umontreal.ssj.probdist.Distribution.
Definition at line 299 of file HalfNormalDist.java.
| double umontreal.ssj.probdist.HalfNormalDist.getSigma | ( | ) |
Returns the parameter \(\sigma\) of this object.
Definition at line 275 of file HalfNormalDist.java.
| double umontreal.ssj.probdist.HalfNormalDist.getStandardDeviation | ( | ) |
Returns the standard deviation.
Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.
Definition at line 83 of file HalfNormalDist.java.
|
static |
Computes the standard deviation of the half-normal distribution with parameters \(\mu\) and \(\sigma\).
| mu | the parameter mu |
| sigma | the parameter sigma |
Definition at line 257 of file HalfNormalDist.java.
| double umontreal.ssj.probdist.HalfNormalDist.getVariance | ( | ) |
Returns the variance.
Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.
Definition at line 79 of file HalfNormalDist.java.
|
static |
Computes and returns the variance \( \mbox{Var}[X] = \left(1-2/\pi\right)\sigma^2. \).
| mu | the parameter mu |
| sigma | the parameter sigma |
Definition at line 243 of file HalfNormalDist.java.
|
static |
Computes the inverse of the distribution function.
| mu | the parameter mu |
| sigma | the parameter sigma |
| u | the value at which the inverse distribution is evaluated |
Definition at line 146 of file HalfNormalDist.java.
| double umontreal.ssj.probdist.HalfNormalDist.inverseF | ( | double | u | ) |
Returns the inverse distribution function \(x = F^{-1}(u)\).
Restrictions: \(u \in[0,1]\).
| u | value at which the inverse distribution function is evaluated |
| IllegalArgumentException | if \(u\) is not in the interval \([0,1]\) |
Reimplemented from umontreal.ssj.probdist.ContinuousDistribution.
Definition at line 71 of file HalfNormalDist.java.
| void umontreal.ssj.probdist.HalfNormalDist.setParams | ( | double | mu, |
| double | sigma ) |
Sets the parameters \(\mu\) and \(\sigma\).
| mu | the parameter mu |
| sigma | the parameter sigma |
Definition at line 285 of file HalfNormalDist.java.
| String umontreal.ssj.probdist.HalfNormalDist.toString | ( | ) |
Returns a String containing information about the current distribution.
Definition at line 310 of file HalfNormalDist.java.