distribution Derived Type

type, public :: distribution

Defines a probability distribution.


Type-Bound Procedures

procedure(distribution_function), public, deferred, pass :: cdf

  • pure elemental function distribution_function(this, x) result(rst) Prototype

    Defines the interface for a probability distribution function.

    Arguments

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

    The 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 :: log_cdf => dist_log_cdf

Natural log of P(X <= x).

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

    Compatibility fallback; override for accurate extreme lower tails.

    Arguments

    Type IntentOptional Attributes Name
    class(distribution), intent(in) :: this
    real(kind=real64), intent(in) :: x

    Return Value real(kind=real64)

procedure, public :: log_pdf => dist_log_pdf

Natural log density (or log probability mass for discrete laws).

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

    Compatibility fallback; override to avoid PDF underflow.

    Arguments

    Type IntentOptional Attributes Name
    class(distribution), intent(in) :: this
    real(kind=real64), intent(in) :: x

    Return Value real(kind=real64)

procedure, public :: log_survival => dist_log_survival

Natural log of P(X > x).

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

    Compatibility fallback; override for accurate extreme upper tails.

    Arguments

    Type IntentOptional Attributes Name
    class(distribution), intent(in) :: this
    real(kind=real64), intent(in) :: x

    Return Value real(kind=real64)

procedure(distribution_property), public, deferred, pass :: mean

  • pure function distribution_property(this) result(rst) Prototype

    Computes the value of a distribution property.

    Arguments

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

    The distribution object.

    Return Value real(kind=real64)

    The property value.

procedure(distribution_property), public, deferred, pass :: median

  • pure function distribution_property(this) result(rst) Prototype

    Computes the value of a distribution property.

    Arguments

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

    The distribution object.

    Return Value real(kind=real64)

    The property value.

procedure(distribution_property), public, deferred, pass :: mode

  • pure function distribution_property(this) result(rst) Prototype

    Computes the value of a distribution property.

    Arguments

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

    The distribution object.

    Return Value real(kind=real64)

    The property value.

procedure(distribution_function), public, deferred, pass :: pdf

  • pure elemental function distribution_function(this, x) result(rst) Prototype

    Defines the interface for a probability distribution function.

    Arguments

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

    The 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(distribution_recenter), public, deferred, pass :: recenter

  • subroutine distribution_recenter(this, x) Prototype

    Recenters the distribution about the supplied value.

    Arguments

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

    The 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 :: survival => dist_survival

Upper-tail probability P(X > x), evaluated directly for built-ins.

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

    Compatibility fallback; override to avoid cancellation in upper tails.

    Arguments

    Type IntentOptional Attributes Name
    class(distribution), intent(in) :: this
    real(kind=real64), intent(in) :: x

    Return Value real(kind=real64)

procedure(distribution_property), public, deferred, pass :: variance

  • pure function distribution_property(this) result(rst) Prototype

    Computes the value of a distribution property.

    Arguments

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

    The distribution object.

    Return Value real(kind=real64)

    The property value.