Main Content

Half-Normal Distribution

Overview

The half-normal distribution is a special case of the folded normal and truncated normal distributions. Some applications of the half-normal distribution include modeling measurement data and lifetime data.

Parameters

The half-normal distribution uses the following parameters:

Parameter Description
< μ < Location parameter
σ 0 Scale parameter

The support for the half-normal distribution isxμ.

Usemakedistwith specified parameter values to create a half-normal probability distribution objectHalfNormalDistribution. Usefitdistto fit a half-normal probability distribution object to sample data. Usemleto estimate the half-normal distribution parameter values from sample data without creating a probability distribution object. For more information about working with probability distributions, seeWorking with Probability Distributions.

The Statistics and Machine Learning Toolbox™ implementation of the half-normal distribution assumes a fixed value for the location parameterμ. Therefore, neitherfitdistnormleestimates the value of the parameterμwhen fitting a half-normal distribution to sample data. You can specify a value for theμparameter by using the name-value pair argument'mu'. The default value for the'mu'argument is 0 in bothfitdistandmle.

Probability Density Function

The probability density function (pdf) of the half-normal distribution is

y = f ( x | μ , σ ) = 2 π 1 σ e 1 2 ( x μ σ ) 2 ; x μ ,

whereμis the location parameter andσis the scale parameter. Ifxμ, then the pdf is undefined.

To compute the pdf of the half-normal distribution, create aHalfNormalDistributionprobability distribution object usingfitdistormakedist, then use thepdfmethod to work with the object.

PDF of Half-Normal Probability Distribution

This example shows how changing the values of themuandsigmaparameters alters the shape of the pdf.

Create four probability distribution objects with different parameters.

pd1 = makedist('HalfNormal'); pd2 = makedist('HalfNormal','mu',0,'sigma',2); pd3 = makedist('HalfNormal','mu',0,'sigma',3); pd4 = makedist('HalfNormal','mu',0,'sigma',5);

Compute the probability density functions (pdfs) of each distribution.

x = 0:0.1:10; pdf1 = pdf(pd1,x); pdf2 = pdf(pd2,x); pdf3 = pdf(pd3,x); pdf4 = pdf(pd4,x);

Plot the pdfs on the same figure.

figure; plot(x,pdf1,'r','LineWidth',2) holdon; plot(x,pdf2,'k:','LineWidth',2); plot(x,pdf3,'b-.','LineWidth',2); plot(x,pdf4,'g--','LineWidth',2); legend({'mu = 0, sigma = 1','mu = 0, sigma = 2',...'mu = 0, sigma = 3','mu = 0, sigma = 5'},'Location','NE'); holdoff;

Assigmaincreases, the curve flattens and the peak value becomes smaller.

Cumulative Distribution Function

The cumulative distribution function (cdf) of the half-normal distribution is

y = F ( x ) = e r f ( x μ 2 σ ) = 2 Φ ( x μ σ ) 1 ; x μ ,

whereμis the location parameter,σis the scale parameter,erf(•)is the error function, andΦ(•)is the cdf of the standard normal distribution. Ifxμ, then the cdf is undefined.

To compute the cdf of the half-normal distribution, create aHalfNormalDistributionprobability distribution object usingfitdistormakedist, then use thecdfmethod to work with the object.

CDF of Half-Normal Probability Distribution

This example shows how changing the values of themuandsigmaparameters alters the shape of the cdf.

Create four probability distribution objects with different parameters.

pd1 = makedist('HalfNormal'); pd2 = makedist('HalfNormal','mu',0,'sigma',2); pd3 = makedist('HalfNormal','mu',0,'sigma',3); pd4 = makedist('HalfNormal','mu',0,'sigma',5);

计算(cdf的累积分布函数s) for each probability distribution.

x = 0:0.1:10; cdf1 = cdf(pd1,x); cdf2 = cdf(pd2,x); cdf3 = cdf(pd3,x); cdf4 = cdf(pd4,x);

Plot all four cdfs on the same figure.

figure; plot(x,cdf1,'r','LineWidth',2) holdon; plot(x,cdf2,'k:','LineWidth',2); plot(x,cdf3,'b-.','LineWidth',2); plot(x,cdf4,'g--','LineWidth',2); legend({'mu = 0, sigma = 1','mu = 0, sigma = 2',...'mu = 0, sigma = 3','mu = 0, sigma = 5'},'Location','SE'); holdoff;

Assigmaincreases, the curve of the cdf flattens.

Descriptive Statistics

The mean of the half-normal distribution is

mean = μ + σ 2 π ,

whereμis the location parameter andσis the scale parameter.

The variance of the half-normal distribution is

var = σ 2 ( 1 2 π ) ,

whereσis the scale parameter.

Relationship to Other Distributions

If a random variableZhas a standard normal distribution with a meanμequal to zero and standard deviationσequal to one, then X = μ + σ | Z | has a half-normal distribution with parametersμandσ.

References

[1] Cooray, K. and M.M.A. Ananda. “A Generalization of the Half-Normal Distribution with Applications to Lifetime Data.”Communications in Statistics – Theory and Methods. Vol. 37, Number 9, 2008, pp. 1323–1337.

[2] Pewsey, A. “Large-Sample Inference for the General Half-Normal Distribution.”Communications in Statistics – Theory and Methods. Vol. 31, Number 7, 2002, pp. 1045–1054.

See Also

Related Topics