normal_distribution Derived Type

type, public, extends(distribution) :: normal_distribution

Defines a normal distribution.


Contents


Components

Type Visibility Attributes Name Initial
real(kind=real64), public :: mean_value

The mean value of the distribution.

real(kind=real64), public :: standard_deviation

The standard deviation of the distribution.


Type-Bound Procedures

procedure, public :: cdf => nd_cdf

  • private pure elemental function nd_cdf(this, x) result(rst)

    Computes the cumulative distribution function.

    The CDF for a normal distribution is given as .

    Arguments

    Type IntentOptional Attributes Name
    class(normal_distribution), intent(in) :: this

    The normal_distribution object.

    real(kind=real64), intent(in) :: x

    The value at which to evaluate the function.

    Return Value real(kind=real64)

    The value of the function.

procedure, public :: mean => nd_mean

  • private pure function nd_mean(this) result(rst)

    Computes the mean of the distribution.

    Arguments

    Type IntentOptional Attributes Name
    class(normal_distribution), intent(in) :: this

    The normal_distribution object.

    Return Value real(kind=real64)

    The mean

procedure, public :: median => nd_median

  • private pure function nd_median(this) result(rst)

    Computes the median of the distribution.

    Arguments

    Type IntentOptional Attributes Name
    class(normal_distribution), intent(in) :: this

    The normal_distribution object.

    Return Value real(kind=real64)

    The median.

procedure, public :: mode => nd_mode

  • private pure function nd_mode(this) result(rst)

    Computes the mode of the distribution.

    Arguments

    Type IntentOptional Attributes Name
    class(normal_distribution), intent(in) :: this

    The normal_distribution object.

    Return Value real(kind=real64)

    The mode.

procedure, public :: pdf => nd_pdf

  • private pure elemental function nd_pdf(this, x) result(rst)

    Computes the probability density function.

    The PDF for a normal distribution is given as .

    Arguments

    Type IntentOptional Attributes Name
    class(normal_distribution), intent(in) :: this

    The normal_distribution object.

    real(kind=real64), intent(in) :: x

    The value at which to evaluate the function.

    Return Value real(kind=real64)

    The value of the function.

procedure, public :: standardize => nd_standardize

  • private subroutine nd_standardize(this)

    Standardizes the normal distribution to a mean of 0 and a standard deviation of 1.

    Arguments

    Type IntentOptional Attributes Name
    class(normal_distribution), intent(inout) :: this

    The normal_distribution object.

procedure, public :: standardized_variable => dist_std_var

Computes the standardized variable for the distribution.

  • private pure elemental function dist_std_var(this, x) result(rst)

    Computes the standardized variable for the distribution.

    Arguments

    Type IntentOptional Attributes Name
    class(distribution), intent(in) :: this

    The distribution object.

    real(kind=real64), intent(in) :: x

    The value of interest.

    Return Value real(kind=real64)

    The result.

procedure, public :: variance => nd_variance

  • private pure function nd_variance(this) result(rst)

    Computes the variance of the distribution.

    Arguments

    Type IntentOptional Attributes Name
    class(normal_distribution), intent(in) :: this

    The normal_distribution object.

    Return Value real(kind=real64)

    The variance.