Learn R Programming

sadists (version 0.2.2)

dnf: The doubly non-central F distribution.

Description

Density, distribution function, quantile function and random generation for the doubly non-central F distribution.

Usage

ddnf(x, df1, df2, ncp1, ncp2, log = FALSE, order.max=6)
pdnf(q, df1, df2, ncp1, ncp2, lower.tail = TRUE, log.p = FALSE, order.max=6)
qdnf(p, df1, df2, ncp1, ncp2, lower.tail = TRUE, log.p = FALSE, order.max=6)
rdnf(n, df1, df2, ncp1, ncp2)

Arguments

x, q
vector of quantiles.
df1, df2
the degrees of freedom for the numerator and denominator. We do not recycle these versus the x,q,p,n.
ncp1, ncp2
the non-centrality parameters for the numerator and denominator. We do not recycle these versus the x,q,p,n.
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 Gram-Charlier, Edeworth, or Cornish-Fisher 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]$.

Value

ddnf gives the density, pdnf gives the distribution function, qdnf gives the quantile function, and rdnf generates random deviates.Invalid arguments will result in return value NaN with a warning.

Details

Suppose $x_i ~ X^2(delta_i,v_i)$ be independent non-central chi-squares for $i=1,2$. Then $$Y = \frac{x_1/\nu_1}{x_2/\nu_2}$$ takes a doubly non-central F distribution with degrees of freedom $v_1, v_2$ and non-centrality parameters $delta_1,delta_2$.

See Also

(singly non-central) F distribution functions, df, pf, qf, rf.

Examples

Run this code
rv <- rdnf(500, df1=100,df2=500,ncp1=1.5,ncp2=12)
d1 <- ddnf(rv, df1=100,df2=500,ncp1=1.5,ncp2=12)
## Not run: 
# plot(rv,d1)
# ## End(Not run)
p1 <- ddnf(rv, df1=100,df2=500,ncp1=1.5,ncp2=12)
# should be nearly uniform:
## Not run: 
# plot(ecdf(p1))
# ## End(Not run)
q1 <- qdnf(ppoints(length(rv)), df1=100,df2=500,ncp1=1.5,ncp2=12)
## Not run: 
# qqplot(x=rv,y=q1)
# ## End(Not run)

Run the code above in your browser using DataLab