Modelica.Math.Distributions.TruncatedNormal

Library of truncated normal distribution functions

Information

This package provides

of the truncated normal distribution. Examples:

For more details
of the normal distribution, see Wikipedia,
of truncated distributions, see Wikipedia.

Extends from Modelica.Icons.Package (Icon for standard packages).

Package Content

Name Description
Modelica.Math.Distributions.TruncatedNormal.density density Density of truncated normal distribution
Modelica.Math.Distributions.TruncatedNormal.cumulative cumulative Cumulative distribution function of truncated normal distribution
Modelica.Math.Distributions.TruncatedNormal.quantile quantile Quantile of truncated normal distribution

Modelica.Math.Distributions.TruncatedNormal.density Modelica.Math.Distributions.TruncatedNormal.density

Density of truncated normal distribution

Information

Syntax

Normal.density(u, u_min=0, u_max=1, mu=0, sigma=1);

Description

This function computes the probability density function according to a truncated normal distribution with minimum value u_min, maximum value u_max, mean value of original distribution mu and standard deviation of original distribution sigma (variance = sigma2). Plot of the function:

For more details
of the normal distribution, see Wikipedia,
of truncated distributions, see Wikipedia.

Example

  density(0.5)                // = 1.041828977196953
  density(0.5,-1.5,1.5,1,0.9) // = 0.5365495585520803

See also

TruncatedNormal.cumulative, TruncatedNormal.quantile.

Extends from Modelica.Math.Distributions.Interfaces.partialTruncatedDensity (Common interface of truncated probability density functions).

Inputs

NameDescription
uRandom number over the real axis (-inf < u < inf)
u_minLower limit of u
u_maxUpper limit of u
muExpectation (mean) value of the normal distribution
sigmaStandard deviation of the normal distribution

Outputs

NameDescription
yDensity of u

Modelica.Math.Distributions.TruncatedNormal.cumulative Modelica.Math.Distributions.TruncatedNormal.cumulative

Cumulative distribution function of truncated normal distribution

Information

Syntax

Normal.cumulative(u, u_min=0, u_max=1, mu=0, sigma=1);

Description

This function computes the cumulative distribution function according to a truncated normal distribution with minimum value u_min, maximum value u_max, mean value of original distribution mu and standard deviation of original distribution sigma (variance = sigma2). The returned value y is in the range:

0 ≤ y ≤ 1

Plot of the function:

For more details
of the normal distribution, see Wikipedia,
of truncated distributions, see Wikipedia.

Example

  cumulative(0.5)                 // = 0.5
  cumulative(0.5,-1.5,1.5,1,0.9)  // = 0.4046868865634537

See also

TruncatedNormal.density, TruncatedNormal.quantile.

Extends from Modelica.Math.Distributions.Interfaces.partialTruncatedCumulative (Common interface of truncated cumulative distribution functions).

Inputs

NameDescription
uValue over the real axis (-inf < u < inf)
u_minLower limit of u
u_maxUpper limit of u
muExpectation (mean) value of the normal distribution
sigmaStandard deviation of the normal distribution

Outputs

NameDescription
yValue in the range 0 <= y <= 1

Modelica.Math.Distributions.TruncatedNormal.quantile Modelica.Math.Distributions.TruncatedNormal.quantile

Quantile of truncated normal distribution

Information

Syntax

Normal.quantile(u, y_min=0, y_max=1, mu=0, sigma=1);

Description

This function computes the inverse cumulative distribution function (= quantile) according to a truncated normal distribution with minimum value u_min, maximum value u_max, mean value of original distribution mu and standard deviation of original distribution sigma (variance = sigma2). Input argument u must be in the range:

0 < u < 1

Output argument y is in the range:

y_min ≤ y ≤ y_max

Plot of the function:

For more details
of the normal distribution, see Wikipedia,
of truncated distributions, see Wikipedia.

Example

  quantile(0.001)           // = 0.001087357613043849;
  quantile(0.5,0,1,0.5,0.9) // = 0.5

See also

TruncatedNormal.density, TruncatedNormal.cumulative.

Extends from Modelica.Math.Distributions.Interfaces.partialTruncatedQuantile (Common interface of truncated quantile functions (= inverse cumulative distribution functions)).

Inputs

NameDescription
uRandom number in the range 0 <= u <= 1
y_minLower limit of y
y_maxUpper limit of y
muExpectation (mean) value of the normal distribution
sigmaStandard deviation of the normal distribution

Outputs

NameDescription
yRandom number u transformed according to the given distribution
Automatically generated Tue Apr 05 09:37:05 2016.