public class NonCentralChiSquaredDistribution extends Object implements ProbabilityDistribution<Double>
GammaFunction).
For the case where $r + \lambda > 2000$, the implementation of the cdf is taken from "An Approximation for the Noncentral Chi-Squared Distribution", Fraser et al. (link). Otherwise, the algorithm is taken from "Computing the Non-Central Chi-Squared Distribution Function", Ding.
| Constructor and Description |
|---|
NonCentralChiSquaredDistribution(double degrees,
double nonCentrality)
Creates an instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
double |
getCDF(Double x)
Returns the cumulative distribution function for a value
|
double |
getDegrees()
Gets the number of degrees of freedom.
|
double |
getInverseCDF(Double p)
Given a probability, return the value that returns this cdf
|
double |
getNonCentrality()
Gets the non-centrality parameter.
|
double |
getPDF(Double x)
Return the probability density function for a value
|
int |
hashCode() |
double |
nextRandom() |
public NonCentralChiSquaredDistribution(double degrees,
double nonCentrality)
degrees - The number of degrees of freedom, not negative or zerononCentrality - The non-centrality parameter, not negativepublic double getCDF(Double x)
getCDF in interface ProbabilityDistribution<Double>x - The value, not nullpublic double getInverseCDF(Double p)
getInverseCDF in interface ProbabilityDistribution<Double>p - The probability, not null. $0 \geq p \geq 1$UnsupportedOperationException - alwayspublic double getPDF(Double x)
getPDF in interface ProbabilityDistribution<Double>x - The value, not nullUnsupportedOperationException - alwayspublic double nextRandom()
nextRandom in interface ProbabilityDistribution<Double>UnsupportedOperationException - alwayspublic double getDegrees()
public double getNonCentrality()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.