Report a bug
If you spot a problem with this page, click here to create a GitHub issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

mir.stat.distribution.gev

This module contains algorithms for the Generalized Extreme Value (GEV) Distribution.
License:
Authors:
Ilia Ki, John Michael Hall
pure nothrow @nogc @safe T gevPDF(T)(const T x, const T mu, const T sigma, const T xi)
if (isFloatingPoint!T);
Computes the generalized extreme value (GEV) probability density function (PDF).
Parameters:
T x value to evaluate
T mu location
T sigma scale
T xi shape
Examples:
import mir.test: shouldApprox;

gevPDF(-3, 2, 3, -0.5).shouldApprox == 0.02120353011709564;
gevPDF(-1, 2, 3, +0.5).shouldApprox == 0.04884170370329114;
gevPDF(-1, 2, 3, 0.0).shouldApprox == 0.1793740787340172;
pure nothrow @nogc @safe T gevCDF(T)(const T x, const T mu, const T sigma, const T xi)
if (isFloatingPoint!T);
Computes the generalized extreme value (GEV) cumulatve distribution function (CDF).
Parameters:
T x value to evaluate
T mu location
T sigma scale
T xi shape
Examples:
import mir.test: shouldApprox;

gevCDF(-3, 2, 3, -0.5).shouldApprox == 0.034696685646156494;
gevCDF(-1, 2, 3, +0.5).shouldApprox == 0.01831563888873418;
gevCDF(-1, 2, 3, 0.0).shouldApprox == 0.06598803584531254;
pure nothrow @nogc @safe T gevCCDF(T)(const T x, const T mu, const T sigma, const T xi)
if (isFloatingPoint!T);
Computes the generalized extreme value (GEV) complementary cumulatve distribution function (CCDF).
Parameters:
T x value to evaluate
T mu location
T sigma scale
T xi shape
Examples:
import mir.test: shouldApprox;

gevCCDF(-3, 2, 3, -0.5).shouldApprox == 0.965303314353844;
gevCCDF(-1, 2, 3, +0.5).shouldApprox == 0.981684361111266;
gevCCDF(-1, 2, 3, 0.0).shouldApprox == 0.934011964154687;
pure nothrow @nogc @safe T gevInvCDF(T)(const T p, const T mu, const T sigma, const T xi)
if (isFloatingPoint!T);
Computes the generalized extreme value (GEV) inverse cumulative distribution function (InvCDF).
Parameters:
T p value to evaluate
T mu location
T sigma scale
T xi shape
Examples:
import mir.test: shouldApprox;

gevInvCDF(0.034696685646156494, 2, 3, -0.5).shouldApprox == -3;
gevInvCDF(0.01831563888873418, 2, 3, +0.5).shouldApprox == -1;
gevInvCDF(0.06598803584531254, 2, 3, 0.0).shouldApprox == -1;
pure nothrow @nogc @safe T gevLPDF(T)(const T x, const T mu, const T sigma, const T xi)
if (isFloatingPoint!T);
Computes the generalized extreme value (GEV) log probability density function (LPDF).
Parameters:
T x value to evaluate
T mu location
T sigma scale
T xi shape
Examples:
import mir.test: shouldApprox;

gevLPDF(-3, 2, 3, -0.5).shouldApprox == -3.85358759620891;
gevLPDF(-1, 2, 3, +0.5).shouldApprox == -3.01917074698827;
gevLPDF(-1, 2, 3, 0.0).shouldApprox == -1.71828182845905;