Package jdistlib
Class NonCentralT
java.lang.Object
jdistlib.generic.GenericDistribution
jdistlib.NonCentralT
-
Field Summary
FieldsFields inherited from class jdistlib.generic.GenericDistribution
random -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublecumulative(double p, boolean lower_tail, boolean log_p) static final doublecumulative(double t, double df, double ncp, boolean lower_tail, boolean log_p) doubledensity(double x, boolean log) static final 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 final doublequantile(double p, double df, double ncp, boolean lower_tail, boolean log_p) doublerandom()static final doublerandom(double df, double ncp, RandomEngine random) static final double[]random(int n, double df, double ncp, RandomEngine random) Methods inherited from class jdistlib.generic.GenericDistribution
copyBackward, cumulative, cumulative, cumulative, cumulative_hazard, cumulative_hazard, cumulativeInto, density, density, densityInto, getRandomEngine, hazard, hazard, inverse_survival, inverse_survival, quantile, quantile, quantile, quantileInto, random, random, randomInto, setRandomEngine, survival, survival, survival
-
Field Details
-
df
protected double df -
ncp
protected double ncp
-
-
Constructor Details
-
NonCentralT
public NonCentralT(double df, double ncp)
-
-
Method Details
-
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
-
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
-