Standard Normal distribution#
The standard Normal distribution is a parameter-free, symmetric, continuous probability distribution and a special case of the Normal distribution: it has a mean of zero and a standard deviation of one.
In the following, let \(U\) be a random variable that follows a standard Normal distribution, and let \(u\) denote a particular outcome of \(U\). The letter \(U\) is often used to represent a standard Normal random variable.
import fesslix as flx
flx.load_engine()
import numpy as np
import fesslix.plot as flx_plot
import matplotlib.pyplot as plt
%matplotlib inline
Random Number Generator: MT19937 - initialized with rand()=1105953948;
Random Number Generator: MT19937 - initialized with 1000 initial calls.
Syntax#
- property stdn#
Standard Normal distribution
stdnis a distribution type (flx_rv_type) for Random variables in Fesslix.
Example:
rv = flx.rv({'type':'stdn'})
Properties#
- Notation
\(U\sim \mathcal{N}(0,1)\)
- Support
\(u\in\mathbb{R}\)
- Mean
\(\mu_U = 0\)
- Standard deviation
\(\sigma_U = 1\)
- Median
zero
- Mode
zero
- Skewness
zero
- Excess kurtosis
zero
- Entropy
\(\frac{1}{2}\ln\left(2\pi e\right)\)
PDF#
The PDF of the standard Normal distribution is commonly denoted by the Greek letter \(\varphi\):
The density has its maximum at \(\varphi_U(0) \approx 0.4\); its inflection points are \(\varphi_U(\pm 1) \approx 0.24\).
fig, ax = plt.subplots(figsize=(10, 4))
flx_plot.draw_pdf(ax, rv)
ax.set_ylim([0., None])
plt.xlabel(r"$u$")
plt.ylabel(r"$\varphi_U(u)$")
plt.show()
CDF#
The CDF of the standard Normal distribution is commonly denoted by the Greek letter \(\Phi\):
Here \(\mathrm{erf}(\cdot)\) denotes the error function.
The standard Normal distribution has the following property:
\(\Phi_U(-u)=1-\Phi_U(u)\)
fig, ax = plt.subplots(figsize=(10, 4))
flx_plot.draw_cdf(ax, rv)
ax.set_ylim([0., 1.])
plt.xlabel(r"$u$")
plt.ylabel(r"$\Phi_U(u)$")
plt.show()
Quantile function#
The quantile function of the standard Normal distribution is expressed in terms of the inverse error function \(\mathrm{erf}^{-1}(\cdot)\):
Examples#
Generate realizations of a standard Normal random variable#
## generate one realization at a time
for i in range(10):
print(f"{i:3.0f} {rv.sample():5.2f}")
## generate a vector of realizations
smpl_vec = np.empty(10)
rv.sample_array(smpl_vec)
print(smpl_vec)
0 -1.16
1 -0.41
2 0.89
3 0.21
4 0.81
5 0.26
6 -0.74
7 -0.93
8 -0.93
9 -0.93
[ 0.78159121 -0.61052417 -0.29065605 0.972958 1.22178466 0.10829382
-3.29818897 -1.5992497 0.37369618 0.59520119]