Processing math: 100%

log_normal_distribution Derived Type

type, public, extends(distribution) :: log_normal_distribution

Defines a normal distribution.


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 => lnd_cdf

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

    Computes the cumulative distribution function.

    The CDF for a log-normal distribution is given as F(x)=12(1+erf(lnxμσ2))

    Arguments

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

    The log_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 => lnd_range

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

    Gets the defined range for the distribution.

    Arguments

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

    The log_normal_distribution object.

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

    The defined range of the probability distributions [0, infinity). As using a value of infinity may cause issue, this routine returns huge(0.0d0) instead.

procedure, public :: mean => lnd_mean

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

    Computes the mean of the distribution

    Arguments

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

    The log_normal distribution object.

    Return Value real(kind=real64)

    The mean

procedure, public :: median => lnd_median

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

    Computes the median of the distribution

    Arguments

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

    The log_normal distribution object.

    Return Value real(kind=real64)

    The median

procedure, public :: mode => lnd_mode

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

    Computes the mode of the distribution

    Arguments

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

    The log_normal distribution object.

    Return Value real(kind=real64)

    The mode

procedure, public :: pdf => lnd_pdf

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

    Computes the probability density function.

    The PDF for a log-normal distribution is given as f(x)=1xσ2πexp((lnxμ)22σ2)

    Arguments

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

    The log_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 => lnd_recenter

  • private subroutine lnd_recenter(this, x)

    Recenters the distribution about the supplied value.

    Arguments

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

    The log_normal_distribution object.

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

    The value about which to recenter.

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 => lnd_variance

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

    Computes the variance of the distribution

    Arguments

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

    The log_normal distribution object.

    Return Value real(kind=real64)

    The variance