In probability theory, the rectified Gaussian distribution is a modification of the Gaussian distribution when its negative elements are reset to 0 (analogous to an electronic rectifier). It is essentially a mixture of a discrete distribution (constant 0) and a continuous distribution (a truncated Gaussian distribution with interval ( 0 , ∞ ) {\displaystyle (0,\infty )} ) as a result of censoring.
Density function The probability density function of a rectified Gaussian distribution, for which random variables X having this distribution, derived from the normal distribution N ( μ , σ 2 ) , {\displaystyle {\mathcal {N}}(\mu ,\sigma ^{2}),} are displayed as X ∼ N R ( μ , σ 2 ) {\displaystyle X\sim {\mathcal {N}}^{\textrm {R}}(\mu ,\sigma ^{2})} , is given by
f ( x ; μ , σ 2 ) = Φ ( − μ σ ) δ ( x ) + 1 2 π σ 2 e − ( x − μ ) 2 2 σ 2 U ( x ) . {\displaystyle f(x;\mu ,\sigma ^{2})=\Phi {\left(-{\frac {\mu }{\sigma }}\right)}\delta (x)+{\frac {1}{\sqrt {2\pi \sigma ^{2}}}}\;e^{-{\frac {(x-\mu )^{2}}{2\sigma ^{2}}}}{\textrm {U}}(x).}
Here, Φ ( x ) {\displaystyle \Phi (x)} is the cumulative distribution function (cdf) of the standard normal distribution:
Φ ( x ) = 1 2 π ∫ − ∞ x e − t 2 / 2 d t x ∈ R , {\displaystyle \Phi (x)={\frac {1}{\sqrt {2\pi }}}\int _{-\infty }^{x}e^{-t^{2}/2}\,dt\quad x\in \mathbb {R} ,}
δ ( x ) {\displaystyle \delta (x)} is the Dirac delta function
δ ( x ) = { + ∞ , x = 0 0 , x ≠ 0 {\displaystyle \delta (x)={\begin{cases}+\infty ,&x=0\\0,&x\neq 0\end{cases}}}
and, U ( x ) {\displaystyle {\textrm {U}}(x)} is the unit step function:
U ( x ) = { 0 , x ≤ 0 , 1 , x > 0. {\displaystyle {\textrm {U}}(x)={\begin{cases}0,&x\leq 0,\\1,&x>0.\end{cases}}}
Mean and variance Since the unrectified normal distribution has mean μ {\displaystyle \mu } and since in transforming it to the rectified distribution some probability mass has been shifted to a higher value (from negative values to 0), the mean of the rectified distribution is greater than μ . {\displaystyle \mu .}
Since the rectified distribution is formed by moving some of the probability mass toward the rest of the probability mass, the rectification is a mean-preserving contraction combined with a mean-changing rigid shift of the distribution, and thus the variance is decreased; therefore the variance of the rectified distribution is less than σ 2 . {\displaystyle \sigma ^{2}.}
Generating values To generate values computationally, one can use
… excerpt ends here. Continue reading the full article.

