Description Usage Arguments Details Value Note Author(s) References See Also Examples
Density, distribution function, quantile function and random generation for the doubly noncentral t distribution.
1 2 3 4 5 6 7 
x, q 
vector of quantiles. 
df 
the degrees of freedom for the denominator, v.
We do not recycle these versus the 
ncp1, ncp2 
the noncentrality parameters for the numerator and denominator,
respectively, mu and theta
We do not recycle these versus the 
log 
logical; if TRUE, densities f are given as log(f). 
order.max 
the order to use in the approximate density, distribution, and quantile computations, via the GramCharlier, Edeworth, or CornishFisher expansion. 
p 
vector of probabilities. 
n 
number of observations. 
log.p 
logical; if TRUE, probabilities p are given as log(p). 
lower.tail 
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. 
Let Z ~ N(u,1) independently of X ~ x^2(theta,v). The random variable
T = Z / sqrt(X/v)
takes a doubly noncentral t distribution with parameters v, mu, theta.
ddnt
gives the density, pdnt
gives the
distribution function, qdnt
gives the quantile function,
and rdnt
generates random deviates.
Invalid arguments will result in return value NaN
with a warning.
The PDF, CDF, and quantile function are approximated, via the Edgeworth or Cornish Fisher approximations, which may not be terribly accurate in the tails of the distribution. You are warned.
The distribution parameters are not recycled
with respect to the x, p, q
or n
parameters,
for, respectively, the density, distribution, quantile
and generation functions. This is for simplicity of
implementation and performance. It is, however, in contrast
to the usual R idiom for dpqr functions.
Steven E. Pav [email protected]
Krishnan, Marakatha. "Series Representations of the Doubly Noncentral tDistribution." Journal of the American Statistical Association 63, no. 323 (1968): 10041012.
t distribution functions, dt, pt, qt, rt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  rvs < rdnt(128, 20, 1, 1)
dvs < ddnt(rvs, 20, 1, 1)
pvs.H0 < pdnt(rvs, 20, 0, 1)
pvs.HA < pdnt(rvs, 20, 1, 1)
## Not run:
plot(ecdf(pvs.H0))
plot(ecdf(pvs.HA))
## End(Not run)
# compare to singly noncentral
dv1 < ddnt(1, df=10, ncp1=5, ncp2=0, log=FALSE)
dv2 < dt(1, df=10, ncp=5, log=FALSE)
pv1 < pdnt(1, df=10, ncp1=5, ncp2=0, log.p=FALSE)
pv11 < pdnt(1, df=10, ncp1=5, ncp2=0.001, log.p=FALSE)
v2 < pt(1, df=10, ncp=5, log.p=FALSE)
q1 < qdnt(pv1, df=10, ncp1=5, ncp2=0, log.p=FALSE)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.