public class NonCentralT extends GenericDistribution
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) =
df^(df/2) * exp(-.5*ncp^2) /
(sqrt(pi)*gamma(df/2)*(df+x^2)^((df+1)/2)) *
sum_{k=0}^Inf gamma((df + k + df)/2)*ncp^k /
prod(1:k)*(2*x^2/(df+x^2))^(k/2)
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.
|
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,
RandomEngine random) |
static double[] |
random(int n,
double df,
double ncp,
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, survival
public 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) = df^(df/2) * exp(-.5*ncp^2) / (sqrt(pi)*gamma(df/2)*(df+x^2)^((df+1)/2)) * sum_{k=0}^Inf gamma((df + k + df)/2)*ncp^k / prod(1:k)*(2*x^2/(df+x^2))^(k/2) 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.
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, RandomEngine random)
public static final double[] random(int n, double df, double ncp, RandomEngine random)
public double density(double x, boolean log)
density
in class GenericDistribution
public double cumulative(double p, boolean lower_tail, boolean log_p)
cumulative
in class GenericDistribution
public double quantile(double q, boolean lower_tail, boolean log_p)
quantile
in class GenericDistribution
public double random()
random
in class GenericDistribution