Normal distribution.
More...
#include <prrng.h>
|
| normal_distribution (double mu=0, double sigma=1) |
| Constructor.
|
|
template<class T > |
T | pdf (const T &x) |
| Probability density function.
|
|
template<class T > |
T | cdf (const T &x) |
| Cumulative density function.
|
|
template<class T > |
T | quantile (const T &p) |
| Quantile (the inverse of the cumulative density function).
|
|
Normal distribution.
References:
Definition at line 1593 of file prrng.h.
◆ normal_distribution()
prrng::normal_distribution::normal_distribution |
( |
double |
mu = 0 , |
|
|
double |
sigma = 1 |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
mu | Average. |
sigma | Standard deviation. |
Definition at line 1601 of file prrng.h.
◆ cdf()
template<class T >
T prrng::normal_distribution::cdf |
( |
const T & |
x | ) |
|
|
inline |
Cumulative density function.
\(
\Phi(x) = \frac{1}{2} \left[
1 + \mathrm{erf}\left( \frac{x - \mu}{\sigma \sqrt{2}} \right)
\right]
\)
- Parameters
-
- Returns
- Cumulative density for each
x
.
Definition at line 1634 of file prrng.h.
◆ pdf()
template<class T >
T prrng::normal_distribution::pdf |
( |
const T & |
x | ) |
|
|
inline |
Probability density function.
- Parameters
-
- Returns
- Probability density for each
x
.
Definition at line 1615 of file prrng.h.
◆ quantile()
template<class T >
T prrng::normal_distribution::quantile |
( |
const T & |
p | ) |
|
|
inline |
Quantile (the inverse of the cumulative density function).
For a given probability \( p \) the output is
\( x = \mu + \sigma \sqrt{2} \mathrm{erf}^{-1} (2p - 1) \)
- Parameters
-
- Returns
- Quantile for each
p
.
Definition at line 1649 of file prrng.h.
The documentation for this class was generated from the following file: