Processing math: 100%

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 F(x)=12(1+erf(xμσ2)).

    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 :: defined_range => dist_defined_range

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

    Gets the defined range for the distribution.

    Arguments

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

    The distribution object.

    Return Value real(kind=real64), dimension(2)

    The defined range of the probability distributions [min, max]. In the event that either min or max are infinite, a value of huge(0.0d0) is returned as opposed to infinite to avoid possible issues with using these values directly.

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 f(x)=1σ2πexp(12(xμσ)2).

    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 :: recenter => nd_recenter

  • private subroutine nd_recenter(this, x)

    Recenters the distribution about the supplied value.

    Arguments

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

    The normal_distribution object.

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

    The value about which to recenter.

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

  • 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.