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

This module contains algorithms for the Pareto Distribution.
License:
Authors:
John Michael Hall
pure nothrow @nogc @safe T paretoPDF(T)(const T x, const T xMin, const T alpha)
if (isFloatingPoint!T);
Computes the pareto probability density function (PDF).
Parameters:
T x value to evaluate PDF
T xMin scale parameter
T alpha shape parameter
Examples:
import mir.test: shouldApprox;

1.0.paretoPDF(1, 3).shouldApprox == 3;
2.0.paretoPDF(1, 3).shouldApprox == 0.1875;
3.0.paretoPDF(2, 4).shouldApprox == 0.2633745;
pure nothrow @nogc @safe T paretoCDF(T)(const T x, const T xMin, const T alpha)
if (isFloatingPoint!T);
Computes the pareto cumulative distribution function (CDF).
Parameters:
T x value to evaluate CDF
T xMin scale parameter
T alpha shape parameter
Examples:
import mir.test: shouldApprox;

1.0.paretoCDF(1, 3).shouldApprox == 0;
2.0.paretoCDF(1, 3).shouldApprox == 0.875;
3.0.paretoCDF(2, 4).shouldApprox == 0.8024691;
pure nothrow @nogc @safe T paretoCCDF(T)(const T x, const T xMin, const T alpha)
if (isFloatingPoint!T);
Computes the pareto complementary cumulative distribution function (CCDF).
Parameters:
T x value to evaluate CCDF
T xMin scale parameter
T alpha shape parameter
Examples:
import mir.test: shouldApprox;

1.0.paretoCCDF(1, 3).shouldApprox == 1;
2.0.paretoCCDF(1, 3).shouldApprox == 0.125;
3.0.paretoCCDF(2, 4).shouldApprox == 0.1975309;
pure nothrow @nogc @safe T paretoInvCDF(T)(const T p, const T xMin, const T alpha)
if (isFloatingPoint!T);
Computes the pareto inverse cumulative distribution function (InvCDF).
Parameters:
T p value to evaluate InvCDF
T xMin scale parameter
T alpha shape parameter
Examples:
import mir.test: shouldApprox;

0.0.paretoInvCDF(1, 3).shouldApprox == 1;
0.875.paretoInvCDF(1, 3).shouldApprox == 2;
0.8024691.paretoInvCDF(2, 4).shouldApprox == 3;
pure nothrow @nogc @safe T paretoLPDF(T)(const T x, const T xMin, const T alpha)
if (isFloatingPoint!T);
Computes the pareto log probability density function (LPDF).
Parameters:
T x value to evaluate LPDF
T xMin scale parameter
T alpha shape parameter
Examples:
import mir.math.common: log;
import mir.test: shouldApprox;

1.0.paretoLPDF(1, 3).shouldApprox == log(paretoPDF(1.0, 1, 3));
2.0.paretoLPDF(1, 3).shouldApprox == log(paretoPDF(2.0, 1, 3));
3.0.paretoLPDF(2, 4).shouldApprox == log(paretoPDF(3.0, 2, 4));