jdistlib
Class NonCentralT
- java.lang.Object
-
- jdistlib.generic.GenericDistribution
-
- jdistlib.NonCentralT
-
public class NonCentralT extends GenericDistribution
-
-
Constructor Summary
Constructors Constructor and Description NonCentralT(double df, double ncp)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublecumulative(double p, boolean lower_tail, boolean log_p)static doublecumulative(double t, double df, double ncp, boolean lower_tail, boolean log_p)doubledensity(double x, boolean log)static doubledensity(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.doublequantile(double q, boolean lower_tail, boolean log_p)static doublequantile(double p, double df, double ncp, boolean lower_tail, boolean log_p)doublerandom()static doublerandom(double df, double ncp, RandomEngine random)static double[]random(int n, double df, double ncp, RandomEngine random)-
Methods inherited from class jdistlib.generic.GenericDistribution
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
-
-
-
-
Method Detail
-
density
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.
-
cumulative
public static final double cumulative(double t, double df, double ncp, boolean lower_tail, boolean log_p)
-
quantile
public static final double quantile(double p, double df, double ncp, boolean lower_tail, boolean log_p)
-
random
public static final double random(double df, double ncp, RandomEngine random)
-
random
public static final double[] random(int n, double df, double ncp, RandomEngine random)
-
density
public double density(double x, boolean log)- Specified by:
densityin classGenericDistribution
-
cumulative
public double cumulative(double p, boolean lower_tail, boolean log_p)- Specified by:
cumulativein classGenericDistribution
-
quantile
public double quantile(double q, boolean lower_tail, boolean log_p)- Specified by:
quantilein classGenericDistribution
-
random
public double random()
- Specified by:
randomin classGenericDistribution
-
-
DMelt 3.0 © DataMelt by jWork.ORG