|
JMSLTM Numerical Library 5.0.1 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.imsl.stat.Cdf
public final class Cdf
Cumulative probability distribution functions, probability density functions, and their inverses.
Method Summary | |
---|---|
static double |
beta(double x,
double pin,
double qin)
Evaluates the beta cumulative probability distribution function. |
static double |
betaMean(double pin,
double qin)
Evaluates the mean of the beta cumulative probability distribution function |
static double |
betaProb(double x,
double pin,
double qin)
Evaluates the beta probability density function. |
static double |
betaVariance(double pin,
double qin)
Evaluates the variance of the beta cumulative probability distribution function |
static double |
binomial(int k,
int n,
double pin)
Evaluates the binomial cumulative probability distribution function. |
static double |
binomialProb(int k,
int n,
double pin)
Evaluates the binomial probability density function. |
static double |
bivariateNormal(double x,
double y,
double rho)
Evaluates the bivariate normal cumulative probability distribution function. |
static double |
chi(double chsq,
double df)
Evaluates the chi-squared cumulative probability distribution function. |
static double |
chiMean(double df)
Evaluates the mean of the chi-squared cumulative probability distribution function |
static double |
chiProb(double chsq,
double df)
Evaluates the chi-squared probability density function |
static double |
chiVariance(double df)
Evaluates the variance of the chi-squared cumulative probability distribution function |
static double |
complementaryChi(double chsq,
double df)
Calculates the complement of the chi-squared distribution. |
static double |
complementaryF(double x,
double dfn,
double dfd)
Calculates the complement of the F distribution function. |
static double |
complementaryStudentsT(double t,
double df)
Calculates the complement of the Student's t distribution. |
static double |
discreteUniform(int x,
int n)
Evaluates the discrete uniform cumulative probability distribution function. |
static double |
discreteUniformProb(int x,
int n)
Evaluates the discrete uniform probability density function. |
static double |
exponential(double x,
double scale)
Evaluates the exponential cumulative probability distribution function. |
static double |
exponentialProb(double x,
double scale)
Evaluates the exponential probability density function |
static double |
extremeValue(double x,
double mu,
double beta)
Evaluates the extreme value cumulative probability distribution function. |
static double |
extremeValueProb(double x,
double mu,
double beta)
Evaluates the extreme value probability density function. |
static double |
F(double x,
double dfn,
double dfd)
Evaluates the F cumulative probability distribution function. |
static double |
FProb(double x,
double dfn,
double dfd)
Evaluates the F probability density function. |
static double |
gamma(double x,
double a)
Evaluates the gamma cumulative probability distribution function. |
static double |
gammaProb(double x,
double a,
double b)
Evaluates the gamma probability density function. |
static double |
geometric(int x,
double pin)
Evaluates the discrete geometric cumulative probability distribution function. |
static double |
geometricProb(int x,
double pin)
Evaluates the discrete geometric probability density function. |
static double |
hypergeometric(int k,
int sampleSize,
int defectivesInLot,
int lotSize)
Evaluates the hypergeometric cumulative probability distribution function. |
static double |
hypergeometricProb(int k,
int sampleSize,
int defectivesInLot,
int lotSize)
Evaluates the hypergeometric probability density function. |
static double |
inverseBeta(double p,
double pin,
double qin)
Evaluates the inverse of the beta cumulative probability distribution function. |
static double |
inverseChi(double p,
double df)
Evaluates the inverse of the chi-squared cumulative probability distribution function. |
static int |
inverseDiscreteUniform(double p,
int n)
Returns the inverse of the discrete uniform cumulative probability distribution function. |
static double |
inverseExponential(double p,
double scale)
Evaluates the inverse of the exponential cumulative probability distribution function. |
static double |
inverseExtremeValue(double p,
double mu,
double beta)
Returns the inverse of the extreme value cumulative probability distribution function. |
static double |
inverseF(double p,
double dfn,
double dfd)
Returns the inverse of the F cumulative probability distribution function. |
static double |
inverseGamma(double p,
double a)
Evaluates the inverse of the gamma cumulative probability distribution function. |
static double |
inverseGeometric(double r,
double pin)
Returns the inverse of the discrete geometric cumulative probability distribution function. |
static double |
inverseLogNormal(double p,
double mu,
double sigma)
Returns the inverse of the standard lognormal cumulative probability distribution function. |
static double |
inverseNoncentralchi(double p,
double df,
double alam)
Evaluates the inverse of the noncentral chi-squared cumulative probability distribution function. |
static double |
inverseNoncentralstudentsT(double p,
int idf,
double delta)
Evaluates the inverse of the noncentral Student's t cumulative probability distribution function. |
static double |
inverseNormal(double p)
Evaluates the inverse of the normal (Gaussian) cumulative probability distribution function. |
static double |
inverseRayleigh(double p,
double alpha)
Returns the inverse of the Rayleigh cumulative probability distribution function. |
static double |
inverseStudentsT(double p,
double df)
Returns the inverse of the Student's t cumulative probability distribution function. |
static double |
inverseUniform(double p,
double aa,
double bb)
Returns the inverse of the uniform cumulative probability distribution function. |
static double |
inverseWeibull(double p,
double gamma,
double alpha)
Returns the inverse of the Weibull cumulative probability distribution function. |
static double |
logNormal(double x,
double mu,
double sigma)
Evaluates the standard lognormal cumulative probability distribution function. |
static double |
logNormalProb(double x,
double mu,
double sigma)
Evaluates the standard lognormal probability density function. |
static double |
noncentralchi(double chsq,
double df,
double alam)
Evaluates the noncentral chi-squared cumulative probability distribution function. |
static double |
noncentralstudentsT(double t,
int idf,
double delta)
Evaluates the noncentral Student's t cumulative probability distribution function. |
static double |
normal(double x)
Evaluates the normal (Gaussian) cumulative probability distribution function. |
static double |
poisson(int k,
double theta)
Evaluates the Poisson cumulative probability distribution function. |
static double |
poissonProb(int k,
double theta)
Evaluates the Poisson probability density function. |
static double |
Rayleigh(double x,
double alpha)
Evaluates the Rayleigh cumulative probability distribution function. |
static double |
RayleighProb(double x,
double alpha)
Evaluates the Rayleigh probability density function. |
static double |
studentsT(double t,
double df)
Evaluates the Student's t cumulative probability distribution function. |
static double |
uniform(double x,
double aa,
double bb)
Evaluates the uniform cumulative probability distribution function. |
static double |
Weibull(double x,
double gamma,
double alpha)
Evaluates the Weibull cumulative probability distribution function. |
static double |
WeibullProb(double x,
double gamma,
double alpha)
Evaluates the Weibull probability density function. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static double beta(double x, double pin, double qin)
Method beta
evaluates the distribution function of a
beta random variable with parameters pin
and qin
.
This function is sometimes called the incomplete beta ratio and,
with p = pin and q = qin, is
denoted by . It is given by
where is the gamma function. The value of the distribution function is the probability that the random variable takes a value less than or equal to x.
The integral in the expression above is called the incomplete beta function and is denoted by . The constant in the expression is the reciprocal of the beta function (the incomplete function evaluated at one) and is denoted by .
beta
uses the method of Bosten and Battiste (1974).
x
- a double
, the argument at which the function is to be evaluated.pin
- a double
, the first beta distribution parameter.qin
- a double
, the second beta distribution parameter.
double
, the probability that a beta random variable takes
on a value less than or equal to x
.public static double betaMean(double pin, double qin)
pin
- a double
, the first beta distribution parameter.qin
- a double
, the second beta distribution parameter.
double
, the mean of the beta distribution
function.public static double betaProb(double x, double pin, double qin)
x
- a double
, the argument at which the function is to be evaluated.pin
- a double
, the first beta distribution parameter.qin
- a double
, the second beta distribution parameter.
double
, the value of the probability density function at x
.public static double betaVariance(double pin, double qin)
pin
- a double
, the first beta distribution parameter.qin
- a double
, the second beta distribution parameter.
double
, the variance of the beta distribution
function.public static double binomial(int k, int n, double pin)
Method binomial
evaluates the distribution function of
a binomial random variable with parameters n and
p with p=pin. It does this by summing probabilities of the
random variable taking on the specific values in its range. These
probabilities are computed by the recursive relationship
To avoid the possibility of underflow, the probabilities are computed
forward from 0, if k is not
greater than n times p, and
are computed backward from n, otherwise. The
smallest positive machine number, ,
is used as the starting value for summing the probabilities, which are
rescaled by if forward
computation is performed and by if
backward computation is done. For the special case of
p = 0, binomial
is set to
1; and for the case p = 1,
binomial
is set to 1 if
k = n and to 0 otherwise.
k
- the int
argument for which the binomial distribution function
is to be evaluated.n
- the int
number of Bernoulli trials.pin
- a double
scalar value representing the
probability of success on each independent trial.
double
scalar value representing the probability
that a binomial random variable takes a value less than or
equal to k
. This value is the probability that k
or fewer successes
occur in n
independent Bernoulli trials, each of which
has a pin
probability of success.public static double binomialProb(int k, int n, double pin)
Method binomialProb
evaluates the probability that a
binomial random variable with parameters n and
p with p=pin takes on the value k. It
does this by computing probabilities of the random variable taking on
the values in its range less than (or the values greater than)
k. These probabilities are computed by the
recursive relationship
To avoid the possibility of underflow, the probabilities are computed forward from 0, if k is not greater than , and are computed backward from n, otherwise. The smallest positive machine number, , is used as the starting value for computing the probabilities, which are rescaled by if forward computation is performed and by if backward computation is done.
For the special case of p = 0,
binomialProb
is set to 0 if
k is greater than 0 and to
1 otherwise; and for the case p = 1,
binomialProb
is set to 0 if
k is less than n and to
1 otherwise.
k
- the int
argument for which the binomial distribution function
is to be evaluated.n
- the int
number of Bernoulli trials.pin
- a double
scalar value representing the
probability of success on each independent trial.
double
scalar value representing the probability that
a binomial random variable takes a value equal to k
.public static double bivariateNormal(double x, double y, double rho)
x
- is the x-coordinate of the point for which the
bivariate normal distribution function is to be evaluated.y
- is the y-coordinate of the point for which the
bivariate normal distribution function is to be evaluated.rho
- is the correlation coefficient.
rho
satisfies
and
.public static double chi(double chsq, double df)
Method chi
evaluates the distribution function,
F, of a chi-squared random variable with
df
degrees of freedom, that is, with
, and ,
where is the gamma function. The value of the distribution function at the point x is the probability that the random variable takes a value less than or equal to x.
For , chi
uses the
Wilson-Hilferty approximation (Abramowitz and Stegun 1964, equation
26.4.17) to the normal distribution, and method normal
is used to evaluate the normal distribution function.
For , chi
uses series
expansions to evaluate the distribution function. If
, chi
uses the
series 6.5.29 in Abramowitz and Stegun (1964), otherwise, it uses the
asymptotic expansion 6.5.32 in Abramowitz and Stegun.
For greater right tail accuracy, see complementaryChi(double, double)
.
chsq
- a double
scalar value representing the argument
at which the function is to be evaluated.df
- a double
scalar value representing the number
of degrees of freedom. This must be at least 0.5.
double
scalar value representing the
probability that a chi-squared random variable
takes a value less than or equal to chsq
.public static double chiMean(double df)
df
- a double
scalar value representing the number
of degrees of freedom. This must be at least 0.5.
double
, the mean of the chi-squared distribution
function.public static double chiProb(double chsq, double df)
chsq
- a double
scalar value representing the argument
at which the function is to be evaluated.df
- a double
scalar value representing the number
of degrees of freedom. This must be at least 0.5.
double
scalar value, the value of the probability density function at chsq
.public static double chiVariance(double df)
df
- a double
scalar value representing the number
of degrees of freedom. This must be at least 0.5.
double
, the variance of the chi-squared distribution
function.public static double complementaryChi(double chsq, double df)
Method complementaryChi
evaluates the distribution function,
, of a chi-squared random variable with
df
degrees of freedom, that is, with
, and ,
where is the gamma function. The value of the distribution function at the point x is the probability that the random variable takes a value greater than x.
For , complementaryChi
uses the
Wilson-Hilferty approximation (Abramowitz and Stegun 1964, equation
26.4.17) to 1 - normal distribution, and method normal
is used to evaluate the normal distribution function.
For , complementaryChi
uses series
expansions to evaluate the distribution function. If
, complementaryChi
uses the
series 6.5.29 in Abramowitz and Stegun (1964), otherwise, it uses the
asymptotic expansion 6.5.32 in Abramowitz and Stegun.
This function provides higher right tail accuracy for the Chi-squared distribution.
chsq
- a double
scalar value at which is to be
evaluated.df
- a double
scalar value representing the
number of degrees of freedom. This must be at least
0.5.
double
scalar value representing the
probability that a chi-squared random variable
takes a value greater than chsq
.public static double complementaryF(double x, double dfn, double dfd)
complementaryF
evaluates one minus the distribution
function of a Snedecor's F random variable with dfn
numerator degrees of freedom and dfd
denominator degrees of
freedom. The function is evaluated by making a transformation to a beta
random variable and then using the function beta
. If
X is an F variate with and
degrees of freedom and
, then Y
is a beta variate with parameters and
. complementaryF
also uses a
relationship between F random variables that can be expressed as
follows:
This function provides higher right tail accuracy for the F distribution.
x
- a double
, the argument at which is to be
evaluated.dfn
- a double
, the numerator degrees of freedom.
It must be positive.dfd
- a double
, the denominator degrees of
freedom. It must be positive.
double
, the probability that an F
random variable takes on a value greater than
x
.public static double complementaryStudentsT(double t, double df)
Method complementaryStudentsT
evaluates one minus the
distribution function of a Student's t random variable with
df
degrees of freedom. If the square of t is greater
than or equal to df
, the relationship of a
t to an f random variable (and
subsequently, to a beta random variable) is exploited, and routine
beta
is used. Otherwise, the method described by Hill
(1970) is used. If df
is not an integer, if df
is greater than 19, or if df
is greater than 200, a
Cornish-Fisher expansion is used to evaluate the distribution function.
If df
is less than 20 and
is less than
2.0, a trigonometric series (see Abramowitz and
Stegun 1964, equations 26.7.3 and 26.7.4, with some rearrangement) is
used. For the remaining cases, a series given by Hill (1970) that
converges well for large values of t
is used.
This function provides higher right tail accuracy for the Student's t distribution.
t
- a double
scalar value for which is to be evaluateddf
- a double
scalar value representing the number
of degrees of freedom. This must be at least one.
double
scalar value representing the
probability that a Student's t random variable
takes a value greater than t
.public static double discreteUniform(int x, int n)
x
- an int
scalar value representing the argument
at which the function is to be evaluated.
x
should be a value between the lower
limit 0 and upper limit n
n
- an int
scalar value representing the
upper limit of the discrete uniform distribution.
double
scalar value representing the probability
that a discrete uniform random variable takes a value
less than or equal to x
.public static double discreteUniformProb(int x, int n)
x
- an int
argument for which the discrete
uniform probability density function is to be evaluated.
x
should be a value between the lower
limit 0 and upper limit n
n
- an int
scalar value representing the
upper limit of the discrete uniform distribution.
double
scalar value representing the
probability that a discrete uniform random variable takes a
value equal to x
.public static double exponential(double x, double scale)
Method exponential
is a special case of the gamma
distribution function, which evaluates the distribution function,
F, with scale parameter b and shape parameter a,
used in the gamma distribution function equal to 1.0. That is,
where is the gamma function. (The gamma function is the integral from 0 to of the same integrand as above). The value of the distribution function at the point x is the probability that the random variable takes a value less than or equal to x.
If x
is less than or equal to 1.0,
gamma
uses a series expansion. Otherwise, a continued
fraction expansion is used. (See Abramowitz and Stegun, 1964.)
x
- a double
scalar value representing the
argument at which the function is to be evaluated.scale
- a double
scalar value representing the scale
parameter, .
double
scalar value representing the
probability that an exponential random variable takes
on a value less than or equal to x
.public static double exponentialProb(double x, double scale)
x
- a double
scalar value representing the
argument at which the function is to be evaluated.scale
- a double
scalar value representing the scale parameter.
double
scalar value, the value of the probability density function at x
.public static double extremeValue(double x, double mu, double beta)
Method extremeValue
, also known as the Gumbel minimum
distribution, evaluates the extreme value distribution function,
F, of a uniform random variable with location parameter
and shape parameter ; that is,
The case where and is called the standard Gumbel distribution.
Random numbers are generated by evaluating uniform variates , equating the continuous distribution function, and then solving for by first computing .
x
- a double
scalar value representing the
argument at which the function is to be evaluated.mu
- a double
scalar value representing the
location parameter, .beta
- a double
scalar value representing the scale
parameter,
double
scalar value representing the
probability that an extreme value random variable takes
on a value less than or equal to x
.public static double extremeValueProb(double x, double mu, double beta)
x
- a double
scalar value representing the
argument at which the function is to be evaluated.mu
- a double
scalar value representing the location parameter.beta
- a double
scalar value representing the scale parameter.
double
scalar value representing the probability density function at x
.public static double F(double x, double dfn, double dfd)
F
evaluates the distribution function of a Snedecor's F
random variable with dfn
numerator degrees of freedom and
dfd
denominator degrees of freedom. The function is
evaluated by making a transformation to a beta random variable and then
using the function beta
. If X is an
F variate with and
degrees of freedom and
, then Y
is a beta variate with parameters and
. F
also uses a relationship
between F random variables that can be expressed as
follows:
For greater right tail accuracy, see complementaryF(double, double, double)
.
x
- a double
, the argument at which
the function is to be evaluated.dfn
- a double
, the numerator degrees
of freedom. It must be positive.dfd
- a double
, the denominator degrees
of freedom. It must be positive.
double
, the probability that an
F random variable takes on a value less than or
equal to x
.public static double FProb(double x, double dfn, double dfd)
The probability density function of the F distribution is
where and are the shape parametersdfn
and dfd
and is
the gamma function,
.
x
- a double
, the argument at which
the function is to be evaluated.dfn
- a double
, the numerator degrees
of freedom. It must be positive.dfd
- a double
, the denominator degrees
of freedom. It must be positive.
double
, the value of the probability density function at x
.public static double gamma(double x, double a)
Method gamma
evaluates the distribution function,
F, of a gamma random variable with shape parameter
a; that is,
where is the gamma function. (The gamma function is the integral from 0 to of the same integrand as above). The value of the distribution function at the point x is the probability that the random variable takes a value less than or equal to x.
The gamma distribution is often defined as a two-parameter distribution with a scale parameter b (which must be positive), or even as a three-parameter distribution in which the third parameter c is a location parameter. In the most general case, the probability density function over is
If T is such a random variable with parameters
a, b, and c,
the probability that can be obtained from
gamma
by setting .
If X is less than a or if
X is less than or equal to 1.0,
gamma
uses a series expansion. Otherwise, a continued
fraction expansion is used. (See Abramowitz and Stegun, 1964.)
x
- a double
scalar value representing the
argument at which the function is to be evaluated.a
- a double
scalar value representing the
shape parameter. This must be positive.
double
scalar value representing the
probability that a gamma random variable takes
on a value less than or equal to x
.public static double gammaProb(double x, double a, double b)
x
- a double
scalar value representing the
argument at which the function is to be evaluated.a
- a double
scalar value representing the
shape parameter. This must be positive.b
- a double
scalar value representing the
scale parameter. This must be positive.
double
scalar value, the probability density function at x
.public static double geometric(int x, double pin)
x
- an int
scalar value representing the argument
at which the function is to be evaluatedpin
- an double
scalar value representing the probability parameter
for each independent trial (the probability of success for each
independent trial).
double
scalar value representing the probability
that a geometric random variable takes a value
less than or equal to x
. The return value is the
probability that up to x
trials would be observed
before observing a success.public static double geometricProb(int x, double pin)
Method geometricProb
evaluates the geometric distribution
for the number of trials before the first success.
x
- the int
argument for which the geometric
probability function is to be evaluatedpin
- a double
scalar value representing the
probability parameter of the geometric distribution
(the probability of success for each independent trial)
double
scalar value representing the
probability that a geometric random variable takes a
value equal to x
.public static double hypergeometric(int k, int sampleSize, int defectivesInLot, int lotSize)
Method hypergeometric
evaluates the distribution
function of a hypergeometric random variable with parameters
n, l, and m.
The hypergeometric random variable X can be thought
of as the number of items of a given type in a random sample of size
n that is drawn without replacement from a
population of size l containing m
items of this type. The probability function is
where .
If k is greater than or equal to
i and less than or equal to ,
hypergeometric
sums the terms in this expression for
j going from i up to
k. Otherwise, hypergeometric
returns
0 or 1, as appropriate. So, as
to avoid rounding in the accumulation, hypergeometric
performs the summation differently depending on whether or not
k is greater than the mode of the distribution,
which is the greatest integer less than or equal to
.
k
- an int
, the argument at which
the function is to be evaluated.sampleSize
- an int
, the sample size, n
.defectivesInLot
- an int
, the number of defectives
in the lot, m
.lotSize
- an int
, the lot size, l
.
double
, the probability that a
hypergeometric random variable takes a value
less than or equal to k
.public static double hypergeometricProb(int k, int sampleSize, int defectivesInLot, int lotSize)
Method hypergeometricProb
evaluates the probability
density function of a hypergeometric random variable with parameters
n, l, and m.
The hypergeometric random variable X can be thought
of as the number of items of a given type in a random sample of size
n that is drawn without replacement from a
population of size l containing m
items of this type. The probability density function is:
where i = max(0, n - l + m).
hypergeometricProb
evaluates the expression using log
gamma functions.
k
- an int
, the argument at which
the function is to be evaluated.sampleSize
- an int
, the sample size, n
.defectivesInLot
- an int
, the number of defectives
in the lot, m
.lotSize
- an int
, the lot size, l
.
double
, the probability that a
hypergeometric random variable takes on a value
equal to k
.public static double inverseBeta(double p, double pin, double qin)
Method inverseBeta
evaluates the inverse distribution
function of a beta random variable with parameters pin
and
qin
, that is, with P = p,
p = pin, and q = qin, it
determines x (equal to
inverseBeta (p, pin, qin)
), such that
where is the gamma function. The probability that the random variable takes a value less than or equal to x is P.
p
- a double
, the probability for which the inverse of the
beta CDF is to be evaluated.pin
- a double
, the first beta distribution parameter.qin
- a double
, the second beta distribution parameter.
double
, the probability that a beta random
variable takes a value less than or equal to this returned
value is p
.public static double inverseChi(double p, double df)
Method inverseChi
evaluates the inverse distribution
function of a chi-squared random variable with df
degrees
of freedom, that is, with P = p and
v = df, it determines x (equal
to inverseChi(p, df)
), such that
where is the gamma function. The probability that the random variable takes a value less than or equal to x is P.
For , inverseChi
uses
bisection, if or
, or regula falsi to find the point at
which the chi-squared distribution function is equal to P.
The distribution function is evaluated using chi
.
For , a modified Wilson-Hilferty
approximation (Abramowitz and Stegun 1964, equation 26.4.18) to the
normal distribution is used, and inverseNormal
is used to
evaluate the inverse of the normal distribution function. For
, the ordinary Wilson-Hilferty
approximation (Abramowitz and Stegun 1964, equation 26.4.17) is used.
p
- a double
scalar value representing the probability
for which the inverse chi-squared function is to be evaluated.df
- a double
scalar value representing the number of
degrees of freedom. This must be at least 0.5.
double
scalar value. The probability
that a chi-squared random variable takes a value less than or
equal to this returned value is p
.public static int inverseDiscreteUniform(double p, int n)
p
- a double
scalar value representing
the probability for which the inverse
discrete uniform function is to be evaluatedn
- an int
scalar value representing the
upper limit of the discrete uniform distribution
int
scalar value. The probability
that a discrete uniform random variable takes a value less than or
equal to this returned value is p
.public static double inverseExponential(double p, double scale)
Method inverseExponential
evaluates the inverse distribution
function of a gamma random variable with scale parameter =b and
shape parameter a=1.0, that is, it determines
, such that
where is the gamma function. The
probability that the random variable takes a value less than or equal to
x is P. See the documentation
for routine gamma
for further discussion of the gamma
distribution.
inverseExponential
uses bisection and modified regula falsi
to invert the distribution function, which is evaluated using method
gamma
.
p
- a double
scalar value representing the
probability at which the function is to be evaluated.scale
- a double
scalar value representing the scale parameter.
double
scalar value. The probability
that an exponential random variable takes a value less than or
equal to this returned value is p
.public static double inverseExtremeValue(double p, double mu, double beta)
p
- a double
scalar value representing
the probability for which the inverse
extreme value function is to be evaluated.mu
- a double
scalar value representing the location parameter.beta
- a double
scalar value representing the scale parameter.
double
scalar value. The probability
that an extreme value random variable takes a value less than or
equal to this returned value is p
.public static double inverseF(double p, double dfn, double dfd)
Method inverseF
evaluates the inverse distribution
function of a Snedecor's F random variable with
dfn
numerator degrees of freedom and dfd
denominator degrees of freedom. The function is evaluated by making a
transformation to a beta random variable and then using
inverseBeta
. If X is an
F variate with and
degrees of freedom and
, then Y
is a beta variate with parameters and
. If ,
inverseF
uses this relationship directly, otherwise, it
also uses a relationship between X random variables
that can be expressed as follows, using f
, which is the
F cumulative distribution function:
p
- a double
, the probability for which the
inverse of the F distribution function is to
be evaluated. Argument p must be in the open
interval (0.0, 1.0).dfn
- a double
, the numerator degrees of
freedom. It must be positive.dfd
- a double
, the denominator degrees of
freedom. It must be positive.
double
, the probability that an F
random variable takes a value less than or equal
to this returned value is p
.public static double inverseGamma(double p, double a)
Method inverseGamma
evaluates the inverse distribution
function of a gamma random variable with shape parameter
a, that is, it determines
, such that
where is the gamma function. The
probability that the random variable takes a value less than or equal to
x is P. See the documentation
for routine gamma
for further discussion of the gamma
distribution.
inverseGamma
uses bisection and modified regula falsi
to invert the distribution function, which is evaluated using method
gamma
.
p
- a double
scalar value representing the
probability at which the function is to be evaluated.a
- a double
scalar value representing the
shape parameter. This must be positive.
double
scalar value. The probability
that a gamma random variable takes a value less than or
equal to this returned value is p
.public static double inverseGeometric(double r, double pin)
r
- a double
scalar value representing
the probability for which the inverse
geometric function is to be evaluatedpin
- an int
scalar value representing the probability parameter
for each independent trial (the probability of success for each
independent trial).
double
scalar value. The probability
that a geometric random variable takes a value less than or
equal to this returned value is the input probability, r
.public static double inverseLogNormal(double p, double mu, double sigma)
p
- a double
scalar value representing
the probability for which the inverse
lognormal function is to be evaluated.mu
- a double
scalar value representing the location parameter.sigma
- a double
scalar value representing the shape parameter.
sigma
must be a positive.
double
scalar value. The probability
that a standard lognormal random variable takes a value less than or
equal to this returned value is p
.public static double inverseNoncentralchi(double p, double df, double alam)
Method inverseNoncentralchi
evaluates the inverse distribution
function of a noncentral chi-squared random variable with df
degrees
of freedom and noncentrality parameter alam
, that is, with P = p,
, and , it
determines inverseNoncentralchi(p, df, alam)
), such that
where is the gamma function. The probability that the random variable takes a value less than or equal to is .
Method inverseNoncentralchi
uses bisection and modified regula falsi to invert the distribution
function, which is evaluated using noncentralchi
. See noncentralchi
for an
alternative definition of the noncentral chi-squared random variable in terms of normal random variables.
p
- a double
scalar value representing the probability
for which the inverse noncentral chi-squared distribution
function is to be evaluated. p
must be in the
open interval (0.0, 1.0).df
- a double
scalar value representing the number of
degrees of freedom. This must be at least 0.5. but
less than or equal to 200,000.alam
- a double
scalar value representing the noncentrality
parameter. This must be nonnegative, and alam + df
must be less than or equal to 200,000.
double
scalar value. The probability
that a noncentral chi-squared random variable takes a value less than or
equal to this returned value is p
.public static double inverseNoncentralstudentsT(double p, int idf, double delta)
Method inverseNoncentralstudentsT
evaluates the inverse distribution function
of a noncentral t random variable with idf
degrees of freedom and noncentrality parameter delta
; that is, with
, , , it determines inverseNoncentralstudentsT(p, idf, delta)
), such that
where is the gamma function.
The probability that the random variable takes a value less than or
equal to is P
. See noncentralstudentsT
for an alternative
definition in terms of normal and chi-squared random variables. The method inverseNoncentralstudentsT
uses bisection and modified regula falsi to invert the distribution function, which is evaluated using
noncentralstudentsT
.
p
- a double
scalar value representing the probability for
which the function is to be evaluated.idf
- an int
scalar value representing the number of
degrees of freedom. This must be positive.delta
- a double
scalar value representing the noncentrality
parameter.
double
scalar value. The probability
that a noncentral Student's t random variable takes a value less than or
equal to this returned value is p
.public static double inverseNormal(double p)
Method inverseNormal
evaluates the inverse of the
distribution function, , of a standard normal
(Gaussian) random variable, that is, inverseNormal
, where
The value of the distribution function at the point x is the probability that the random variable takes a value less than or equal to x. The standard normal distribution has a mean of 0 and a variance of 1.
p
- a double
scalar value representing the probability
at which the function is to be evaluated.
double
scalar value. The probability
that a standard normal random variable takes a value less than or
equal to this returned value is p
.public static double inverseRayleigh(double p, double alpha)
p
- a double
scalar value representing
the probability for which the inverse
Rayleigh function is to be evaluated.alpha
- a double
scalar value representing the scale parameter.
double
scalar value. The probability
that a Rayleigh random variable takes a value less than or
equal to this returned value is p
.public static double inverseStudentsT(double p, double df)
inverseStudentsT
evaluates the inverse distribution
function of a Student's t random variable with
df
degrees of freedom. Let v = df. If
v equals 1 or
2, the inverse can be obtained in closed form, if
v is between 1 and 2, the relationship of a
t to a beta random variable is exploited and
inverseBeta
is used to evaluate the inverse; otherwise the
algorithm of Hill (1970) is used. For small values of v
greater than 2, Hill's algorithm inverts an integrated expansion in
of the t density.
For larger values, an asymptotic inverse Cornish-Fisher type expansion
about normal deviates is used.
p
- a double
scalar value representing the probability
for which the inverse Student's t function is to be evaluated.df
- a double
scalar value representing the number of
degrees of freedom. This must be at least one.
double
scalar value. The probability
that a Student's t random variable takes a value less than or
equal to this returned value is p
.public static double inverseUniform(double p, double aa, double bb)
p
- a double
scalar value representing
the probability for which the inverse
uniform function is to be evaluated.aa
- a double
scalar value representing the minimum value.bb
- a double
scalar value representing the maximum value.
double
scalar value. The probability
that a uniform random variable takes a value less than or
equal to this returned value is p
.public static double inverseWeibull(double p, double gamma, double alpha)
p
- a double
scalar value representing
the probability for which the inverse
Weibull function is to be evaluated.gamma
- a double
scalar value representing the shape parameter.alpha
- a double
scalar value representing the scale parameter.
double
scalar value. The probability
that a Weibull random variable takes a value less than or
equal to this returned value is p
.public static double logNormal(double x, double mu, double sigma)
x
- a double
scalar value representing the argument
at which the function is to be evaluated.mu
- a double
scalar value representing the location parameter.sigma
- a double
scalar value representing the shape parameter.
sigma
must be a positive.
double
scalar value representing the probability
that a standard lognormal random variable
takes a value less than or equal to x
.public static double logNormalProb(double x, double mu, double sigma)
x
- a double
scalar value representing the argument
at which the function is to be evaluated.mu
- a double
scalar value representing the location parameter.sigma
- a double
scalar value representing the shape parameter.
sigma
must be a positive.
double
scalar value representing the probability density function at x
.public static double noncentralchi(double chsq, double df, double alam)
Method noncentralchi
evaluates the distribution function,
F, of a noncentral chi-squared random variable with
df
degrees of freedom and noncentrality parameter alam
, that is, with
, , and ,
where is the gamma function. This is a series of central chi-squared distribution functions with Poisson weights. The value of the distribution function at the point x is the probability that the random variable takes a value less than or equal to x.
The noncentral chi-squared random variable can be defined by the distribution function above, or alternatively and equivalently, as the sum of squares of independent normal random variables. If the have independent normal distributions with means and variances equal to one and
then has a noncentral chi-squared distribution with degrees of freedom and noncentrality parameter equal to
With a noncentrality parameter of zero, the noncentral chi-squared distribution is the same as the chi-squared distribution.
noncentralchi
determines the point at which the Poisson weight is greatest, and then
sums forward and backward from that point, terminating when the additional terms are sufficiently
small or when a maximum of 1000 terms have been accumulated. The recurrence relation 26.4.8 of
Abramowitz and Stegun (1964) is used to speed the evaluation of the central chi-squared distribution
functions.
chsq
- a double
scalar value representing the argument
at which the function is to be evaluated.df
- a double
scalar value representing the number
of degrees of freedom. This must be at least 0.5.alam
- a double
scalar value representing the noncentrality
parameter. This must be nonnegative, and alam + df
must be less than or equal to 200,000.
double
scalar value representing the
probability that a chi-squared random variable
takes a value less than or equal to chsq
.public static double noncentralstudentsT(double t, int idf, double delta)
Method noncentralstudentsT
evaluates the distribution function
F
of a noncentral t random variable with idf
degrees of freedom and noncentrality parameter delta
; that is, with
, , and ,
where is the gamma function. The value of the distribution function at the point is the probability that the random variable takes a value less than or equal to .
The noncentral t random variable can be defined by the distribution function above, or alternatively and equivalently, as the ratio of a normal random variable and an independent chi-squared random variable. If w has a normal distribution with mean and variance equal to one, has an independent chi-squared distribution with degrees of freedom, and
then has a noncentral distribution with degrees of freedom and noncentrality parameter .
The distribution function of the noncentral can also be expressed as a
double integral involving a normal density function (see, for example, Owen 1962, page 108). The method
noncentralstudentsT
uses the method of Owen (1962, 1965), which uses repeated integration by parts
on that alternate expression for the distribution function.
t
- a double
scalar value representing the argument
at which the function is to be evaluated.idf
- an int
scalar value representing the number of
degrees of freedom. This must be positive.delta
- a double
scalar value representing the noncentrality
parameter.
double
scalar value representing the probability
that a noncentral Student's t random variable takes a value less than or
equal to t
.public static double normal(double x)
Method normal
evaluates the distribution function,
, of a standard normal (Gaussian) random
variable, that is,
The value of the distribution function at the point x is the probability that the random variable takes a value less than or equal to x.
The standard normal distribution (for which normal
is
the distribution function) has mean of 0 and
variance of 1. The probability that a normal
random variable with mean and variance
is less than y
is given by normal
evaluated at
.
is evaluated by use of the complementary error function, erfc. The relationship is:
x
- a double
scalar value representing the argument
at which the function is to be evaluated.
double
scalar value representing the probability
that a normal variable takes a value less than or equal to x
.public static double poisson(int k, double theta)
poisson
evaluates the distribution function of a Poisson
random variable with parameter theta
. theta
,
which is the mean of the Poisson random variable, must be positive. The
probability function (with ) is
The individual terms are calculated from the tails of the
distribution to the mode of the distribution and summed.
poisson
uses the recursive relationship
with .
k
- the int
argument for which the Poisson distribution function
is to be evaluated.theta
- a double
scalar value representing the mean of the Poisson distribution.
double
scalar value representing the probability that a Poisson random
variable takes a value less than or equal to k.public static double poissonProb(int k, double theta)
Method poissonProb
evaluates the probability density function of
a Poisson random variable with parameter theta
.
theta
, which is the mean of the Poisson random variable,
must be positive. The probability function (with
) is
poissonProb
evaluates this function directly, taking
logarithms and using the log gamma function.
k
- the int
argument for which the Poisson
probability function is to be evaluated.theta
- a double
scalar value representing the
mean of the Poisson distribution.
double
scalar value representing the
probability that a Poisson random variable takes a
value equal to k.public static double Rayleigh(double x, double alpha)
Method Rayleigh
is a special case of Weibull distribution
function where the shape parameter gamma
is 2.0; that is,
where alpha
is the scale parameter.
x
- a double
scalar value representing the argument
at which the function is to be evaluated. It must be non-negative.alpha
- a double
scalar value representing the scale parameter.
double
scalar value representing the probability
that a Rayleigh random variable takes a value less than or
equal to x
.public static double RayleighProb(double x, double alpha)
x
- a double
scalar value representing the argument
at which the function is to be evaluated. It must be non-negative.alpha
- a double
scalar value representing the scale parameter.
double
scalar value representing the probability density function at x
.public static double studentsT(double t, double df)
Method studentsT
evaluates the distribution function of
a Student's t random variable with df
degrees of freedom. If the square of t is greater
than or equal to df
, the relationship of a
t to an f random variable (and
subsequently, to a beta random variable) is exploited, and routine
beta
is used. Otherwise, the method described by Hill
(1970) is used. If df
is not an integer, if df
is greater than 19, or if df
is greater than 200, a
Cornish-Fisher expansion is used to evaluate the distribution function.
If df
is less than 20 and
is less than
2.0, a trigonometric series (see Abramowitz and
Stegun 1964, equations 26.7.3 and 26.7.4, with some rearrangement) is
used. For the remaining cases, a series given by Hill (1970) that
converges well for large values of t
is used.
For greater right tail accuracy, see complementaryStudentsT(double, double)
.
t
- a double
scalar value representing the argument
at which the function is to be evaluateddf
- a double
scalar value representing the number of
degrees of freedom. This must be at least one.
double
scalar value representing the probability
that a Student's t random variable takes a value less than or
equal to t
.public static double uniform(double x, double aa, double bb)
Method uniform
evaluates the distribution function,
F, of a uniform random variable with location parameter
aa and scale parameter bb; that is,
x
- a double
scalar value representing the argument
at which the function is to be evaluated.aa
- a double
scalar value representing the location parameter.bb
- a double
scalar value representing the scale parameter.
double
scalar value representing the probability
that a uniform random variable takes a value less than or
equal to x
.public static double Weibull(double x, double gamma, double alpha)
x
- a double
scalar value representing the argument
at which the function is to be evaluated. It must be non-negative.gamma
- a double
scalar value representing the shape parameter.alpha
- a double
scalar value representing the scale parameter.
double
scalar value representing the probability
that a Weibull random variable takes a value less than or
equal to x
.public static double WeibullProb(double x, double gamma, double alpha)
x
- a double
scalar value representing the argument
at which the function is to be evaluated. It must be non-negative.gamma
- a double
scalar value representing the shape parameter.alpha
- a double
scalar value representing the scale parameter.
double
scalar value, the probability density function at x
.
|
JMSLTM Numerical Library 5.0.1 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |