- Story. The Half-Normal distribution is a Gaussian distribution with zero mean truncated to only have nonzero probability for positive real numbers.
- Parameters. Strictly speaking, the Half-Normal is parametrized by a single positive parameter
. We could, however, translate it so that the truncated Gaussian has a maximum at
and only values greater than or equal to
have nonzero probability.
- Probability density function.

- Support. The Half-Normal distribution is supported on the set
. Usually, we have
, in which case the Half-Normal distribution is supported on the set of nonnegative real numbers.
- Usage
Package |
Syntax |
NumPy |
np.random.normal(mu, sigma) |
SciPy |
scipy.stats.halfnorm(mu, sigma) |
Stan |
real<lower=mu> y; y ~ normal(mu, sigma) |
- Notes.
- In Stan, a Half-Normal is defined by putting bounds on the variable and then using a Normal distribution.
- The Half-Normal distibution is a useful prior for nonnegative parameters that should not be too large and may be very close to zero.
params = [dict(name='µ', start=-0.5, end=0.5, value=0, step=0.01),
dict(name='σ', start=0.1, end=1.0, value=0.2, step=0.01)]
app = distribution_plot_app(x_min=-0.5,
x_max=2,
scipy_dist=st.halfnorm,
params=params,
x_axis_label='y',
title='Half-Normal')
bokeh.io.show(app, notebook_url=notebook_url)