public class NonCentralT
extends jdistlib.generic.GenericDistribution
| Modifier and Type | Field and Description |
|---|---|
protected double |
df |
protected double |
ncp |
| Constructor and Description |
|---|
NonCentralT(double df,
double ncp) |
| Modifier and Type | Method and Description |
|---|---|
double |
cumulative(double p,
boolean lower_tail,
boolean log_p) |
static double |
cumulative(double t,
double df,
double ncp,
boolean lower_tail,
boolean log_p) |
double |
density(double x,
boolean log) |
static double |
density(double x,
double df,
double ncp,
boolean give_log)
From Johnson, Kotz and Balakrishnan (1995) [2nd ed.; formula (31.15), p.516],
the non-central t density is
f(x, df, ncp) =
exp(-.5*ncp^2) * gamma((df+1)/2) / (sqrt(pi*df)* gamma(df/2)) * (df/(df+x^2))^((df+1)/2) *
sum_{j=0}^Inf gamma((df+j+1)/2)/(factorial(j)* gamma((df+1)/2)) * (x*ncp*sqrt(2)/sqrt(df+x^2))^ j
The functional relationship
f(x, df, ncp) = df/x *
(F(sqrt((df+2)/df)*x, df+2, ncp) - F(x, df, ncp))
is used to evaluate the density at x !
|
double |
quantile(double q,
boolean lower_tail,
boolean log_p) |
static double |
quantile(double p,
double df,
double ncp,
boolean lower_tail,
boolean log_p) |
double |
random() |
static double |
random(double df,
double ncp,
jdistlib.rng.RandomEngine random) |
static double[] |
random(int n,
double df,
double ncp,
jdistlib.rng.RandomEngine random) |
cumulative_hazard, cumulative_hazard, cumulative, cumulative, cumulative, density, density, getRandomEngine, hazard, hazard, inverse_survival, inverse_survival, quantile, quantile, quantile, random, random, setRandomEngine, survival, survival, survivalpublic static final double density(double x,
double df,
double ncp,
boolean give_log)
From Johnson, Kotz and Balakrishnan (1995) [2nd ed.; formula (31.15), p.516],
the non-central t density is
f(x, df, ncp) =
exp(-.5*ncp^2) * gamma((df+1)/2) / (sqrt(pi*df)* gamma(df/2)) * (df/(df+x^2))^((df+1)/2) *
sum_{j=0}^Inf gamma((df+j+1)/2)/(factorial(j)* gamma((df+1)/2)) * (x*ncp*sqrt(2)/sqrt(df+x^2))^ j
The functional relationship
f(x, df, ncp) = df/x *
(F(sqrt((df+2)/df)*x, df+2, ncp) - F(x, df, ncp))
is used to evaluate the density at x != 0 and
f(0, df, ncp) = exp(-.5*ncp^2) /
(sqrt(pi)*sqrt(df)*gamma(df/2))*gamma((df+1)/2)
is used for x=0.
All calculations are done on log-scale to increase stability.
FIXME: pnt() is known to be inaccurate in the (very) left tail and for ncp > 38
==> use a direct log-space summation formula in that case * public static final double cumulative(double t,
double df,
double ncp,
boolean lower_tail,
boolean log_p)
public static final double quantile(double p,
double df,
double ncp,
boolean lower_tail,
boolean log_p)
public static final double random(double df,
double ncp,
jdistlib.rng.RandomEngine random)
public static final double[] random(int n,
double df,
double ncp,
jdistlib.rng.RandomEngine random)
public double density(double x,
boolean log)
density in class jdistlib.generic.GenericDistributionpublic double cumulative(double p,
boolean lower_tail,
boolean log_p)
cumulative in class jdistlib.generic.GenericDistributionpublic double quantile(double q,
boolean lower_tail,
boolean log_p)
quantile in class jdistlib.generic.GenericDistributionpublic double random()
random in class jdistlib.generic.GenericDistributionCopyright © 2015. All rights reserved.