# Class NonCentralChiSquaredDistribution

java.lang.Object
net.finmath.functions.NonCentralChiSquaredDistribution

public class NonCentralChiSquaredDistribution extends Object
Implementation of the cumulative distribution function of the non-central Χ2 distribution. The implementation is that of Ding's algorithm, splitting the sum since the first term of the sum is not the largest one (and may be zero). The algorithm uses Kahan summation for the sums and limits the calculation time to avoid infinity loops. The method is currently intended to be used as a benchmark in unit tests only. Note: The implementation currently does not use an alternative algorithm in cases of high non-centrality, like Benton and Krishnamoorthy. Since the number of summation is limited, the method may be inaccurate for high non-centrality.
Author:
Christian Fries, Ralph Rudd
• ## Constructor Summary

Constructors
Constructor
Description
NonCentralChiSquaredDistribution(double degreesOfFreedom, double nonCentrality)
Create non-central Χ2 distribution (non-central chi-squared distribution).
• ## Method Summary

Modifier and Type
Method
Description
double
cumulativeDistribution(double x)
Cumulative distribution function of the non-central Χ2 distribution
double
getDegreesOfFreedom()

double
getNonCentrality()

### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ## Constructor Details

• ### NonCentralChiSquaredDistribution

public NonCentralChiSquaredDistribution(double degreesOfFreedom, double nonCentrality)
Create non-central Χ2 distribution (non-central chi-squared distribution).
Parameters:
degreesOfFreedom - The number of degrees of freedom, positive
nonCentrality - The non-centrality parameter, not negative
• ## Method Details

• ### cumulativeDistribution

public double cumulativeDistribution(double x)
Cumulative distribution function of the non-central Χ2 distribution
Parameters:
x - A sample point
Returns:
The probability of X being below x, given that X is non-central Χ2 distributed
• ### getDegreesOfFreedom

public double getDegreesOfFreedom()
Returns:
The number of degrees of freedom
• ### getNonCentrality

public double getNonCentrality()
Returns:
The non-centrality parameter