umontreal.iro.lecuyer.probdist
Class ChiSquareNoncentralDist
- java.lang.Object
-
- umontreal.iro.lecuyer.probdist.ContinuousDistribution
-
- umontreal.iro.lecuyer.probdist.ChiSquareNoncentralDist
-
- All Implemented Interfaces:
- Distribution
public class ChiSquareNoncentralDist extends ContinuousDistribution
Extends the classContinuousDistributionfor the noncentral chi-square distribution with ν degrees of freedom and noncentrality parameter λ, where ν > 0 and λ > 0. Its density isf (x) = (e-(x+λ)/2)/2(x/λ)(ν-2)/4Iν/2-1((λx)1/2) for x > 0,where Iν(x) is the modified Bessel function of the first kind of order ν given byIν(z) = ∑j=0∞[(z/2)ν+2j]/[j! Γ(ν + j + 1)],where Γ(x) is the gamma function. Notice that this distribution is more general than the chi-square distribution since its number of degrees of freedom can be any positive real number. For λ = 0 and ν a positive integer, we have the ordinary chi-square distribution.The cumulative probability function can be written as
P[X <= x] = ∑j=0∞(e-λ/2(λ/2)j/j!)P[χ2ν+2j <= x],where χ2ν+2j is the central chi-square distribution with ν + 2j degrees of freedom.
-
-
Field Summary
-
Fields inherited from class umontreal.iro.lecuyer.probdist.ContinuousDistribution
decPrec
-
-
Constructor Summary
Constructors Constructor and Description ChiSquareNoncentralDist(double nu, double lambda)Constructs a noncentral chi-square distribution with ν = nu degrees of freedom and noncentrality parameter λ = lambda.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublebarF(double x)Returns the complementary distribution function.static doublebarF(double nu, double lambda, double x)Computes the complementary noncentral chi-square distribution function with ν = nu degrees of freedom and parameter λ = lambda.doublecdf(double x)Returns the distribution function F(x).static doublecdf(double nu, double lambda, double x)Computes the noncentral chi-square distribution function with ν = nu degrees of freedom and parameter λ = lambda.doubledensity(double x)Returns f (x), the density evaluated at x.static doubledensity(double nu, double lambda, double x)Computes the density function for a noncentral chi-square distribution with ν = nu degrees of freedom and parameter λ = lambda.doublegetLambda()Returns the parameter λ of this object.doublegetMean()Returns the mean.static doublegetMean(double nu, double lambda)Computes and returns the mean E[X] = ν + λ of the noncentral chi-square distribution with parameters ν = nu and λ = lambda.doublegetNu()Returns the parameter ν of this object.double[]getParams()Returns a table containing the parameters of the current distribution.doublegetStandardDeviation()Returns the standard deviation.static doublegetStandardDeviation(double nu, double lambda)Computes and returns the standard deviation of the noncentral chi-square distribution with parameters ν = nu and λ = lambda.doublegetVariance()Returns the variance.static doublegetVariance(double nu, double lambda)Computes and returns the variance Var[X] = 2(ν +2λ) of the noncentral chi-square distribution with parameters ν = nu and λ = lambda.doubleinverseF(double u)Returns the inverse distribution function x = F-1(u).static doubleinverseF(double nu, double lambda, double u)Computes the inverse of the noncentral chi-square distribution with ν = nu degrees of freedom and parameter λ = lambda.voidsetParams(double nu, double lambda)Sets the parameters ν = nu and λ = lambda of this object.java.lang.StringtoString()-
Methods inherited from class umontreal.iro.lecuyer.probdist.ContinuousDistribution
getXinf, getXsup, inverseBisection, inverseBrent, setXinf, setXsup
-
-
-
-
Constructor Detail
-
ChiSquareNoncentralDist
public ChiSquareNoncentralDist(double nu, double lambda)Constructs a noncentral chi-square distribution with ν = nu degrees of freedom and noncentrality parameter λ = lambda.
-
-
Method Detail
-
density
public double density(double x)
Description copied from class:ContinuousDistributionReturns f (x), the density evaluated at x.- Specified by:
densityin classContinuousDistribution- Parameters:
x- value at which the density is evaluated- Returns:
- density function evaluated at x
-
cdf
public double cdf(double x)
Description copied from interface:DistributionReturns the distribution function F(x).- Parameters:
x- value at which the distribution function is evaluated- Returns:
- distribution function evaluated at x
-
barF
public double barF(double x)
Description copied from class:ContinuousDistributionReturns the complementary distribution function. The default implementation computes bar(F)(x) = 1 - F(x).- Specified by:
barFin interfaceDistribution- Overrides:
barFin classContinuousDistribution- Parameters:
x- value at which the complementary distribution function is evaluated- Returns:
- complementary distribution function evaluated at x
-
inverseF
public double inverseF(double u)
Description copied from class:ContinuousDistributionReturns the inverse distribution function x = F-1(u). Restrictions: u∈[0, 1].- Specified by:
inverseFin interfaceDistribution- Overrides:
inverseFin classContinuousDistribution- Parameters:
u- value at which the inverse distribution function is evaluated- Returns:
- the inverse distribution function evaluated at u
-
getMean
public double getMean()
Description copied from class:ContinuousDistributionReturns the mean.- Specified by:
getMeanin interfaceDistribution- Overrides:
getMeanin classContinuousDistribution- Returns:
- the mean
-
getVariance
public double getVariance()
Description copied from class:ContinuousDistributionReturns the variance.- Specified by:
getVariancein interfaceDistribution- Overrides:
getVariancein classContinuousDistribution- Returns:
- the variance
-
getStandardDeviation
public double getStandardDeviation()
Description copied from class:ContinuousDistributionReturns the standard deviation.- Specified by:
getStandardDeviationin interfaceDistribution- Overrides:
getStandardDeviationin classContinuousDistribution- Returns:
- the standard deviation
-
density
public static double density(double nu, double lambda, double x)Computes the density function for a noncentral chi-square distribution with ν = nu degrees of freedom and parameter λ = lambda.
-
cdf
public static double cdf(double nu, double lambda, double x)Computes the noncentral chi-square distribution function with ν = nu degrees of freedom and parameter λ = lambda.
-
barF
public static double barF(double nu, double lambda, double x)Computes the complementary noncentral chi-square distribution function with ν = nu degrees of freedom and parameter λ = lambda.
-
inverseF
public static double inverseF(double nu, double lambda, double u)Computes the inverse of the noncentral chi-square distribution with ν = nu degrees of freedom and parameter λ = lambda.
-
getMean
public static double getMean(double nu, double lambda)Computes and returns the mean E[X] = ν + λ of the noncentral chi-square distribution with parameters ν = nu and λ = lambda.- Returns:
- the mean of the Noncentral noncentral chi-square distribution
-
getVariance
public static double getVariance(double nu, double lambda)Computes and returns the variance Var[X] = 2(ν +2λ) of the noncentral chi-square distribution with parameters ν = nu and λ = lambda.- Returns:
- the variance of the noncentral chi-square distribution
-
getStandardDeviation
public static double getStandardDeviation(double nu, double lambda)Computes and returns the standard deviation of the noncentral chi-square distribution with parameters ν = nu and λ = lambda.- Returns:
- the standard deviation of the noncentral chi-square distribution
-
getNu
public double getNu()
Returns the parameter ν of this object.
-
getLambda
public double getLambda()
Returns the parameter λ of this object.
-
setParams
public void setParams(double nu, double lambda)Sets the parameters ν = nu and λ = lambda of this object.
-
getParams
public double[] getParams()
Returns a table containing the parameters of the current distribution.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG