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

This module contains algorithms for the Chi-squared Distribution.
License:
Authors:
Ilia Ki, John Michael Hall
pure nothrow @nogc @safe T chi2PDF(T)(const T x, const uint k)
if (isFloatingPoint!T);
Computes the Chi-squared probability density function (PDF).
Parameters:
T x value to evaluate PDF
uint k degrees of freedom
Examples:
import mir.test: shouldApprox;
0.2.chi2PDF(2).shouldApprox == 0.4524187;
pure nothrow @nogc @safe T chi2CDF(T)(const T x, const uint k)
if (isFloatingPoint!T);
Computes the Chi-squared cumulative distribution function (CDF).
Parameters:
T x value to evaluate CDF
uint k degrees of freedom
Examples:
import mir.test: shouldApprox;
0.2.chi2CDF(2).shouldApprox == 0.09516258;
pure nothrow @nogc @safe T chi2CCDF(T)(const T x, const uint k)
if (isFloatingPoint!T);
Computes the Chi-squared complementary cumulative distribution function (CCDF).
Parameters:
T x value to evaluate CCDF
uint k degrees of freedom
Examples:
import mir.test: shouldApprox;
0.2.chi2CCDF(2).shouldApprox == 0.9048374;
pure nothrow @nogc @safe T chi2InvCDF(T)(const T p, const uint k)
if (isFloatingPoint!T);
Computes the Chi-squared inverse cumulative distribution function (InvCDF).
Parameters:
T p value to evaluate InvCDF
uint k degrees of freedom
Examples:
import mir.test: shouldApprox;
0.09516258.chi2InvCDF(2).shouldApprox == 0.2;
pure nothrow @nogc @safe T chi2LPDF(T)(const T x, const uint k)
if (isFloatingPoint!T);
Computes the Chi-squared probability density function (LPDF).
Parameters:
T x value to evaluate LPDF
uint k degrees of freedom
Examples:
import mir.test: shouldApprox;
0.2.chi2LPDF(2).shouldApprox == -0.7931472;