Learn R Programming

sadists (version 0.2.2)

dneta: The doubly non-central Eta distribution.

Description

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

Usage

ddneta(x, df, ncp1, ncp2, log = FALSE, order.max=6)
pdneta(q, df, ncp1, ncp2, lower.tail = TRUE, log.p = FALSE, order.max=6)
qdneta(p, df, ncp1, ncp2, lower.tail = TRUE, log.p = FALSE, order.max=6)
rdneta(n, df, ncp1, ncp2)

Arguments

x, q
vector of quantiles.
df
the degrees of freedom for the denominator chi square. We do not recycle this 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

ddneta gives the density, pdneta gives the distribution function, qdneta gives the quantile function, and rdneta generates random deviates.Invalid arguments will result in return value NaN with a warning.

Details

Suppose $Z$ is a normal with mean $delta_1$, independent of $X ~ X^2(delta_2,v_2)$, a non-central chi-square with $v_2$ degrees of freedom and non-centrality parameter $delta_2$. Then $$Y = \frac{Z}{\sqrt{Z^2 + X}}$$ takes a doubly non-central Eta distribution with $v_2$ degrees of freedom and non-centrality parameters $delta_1,delta_2$. The square of a doubly non-central Eta is a doubly non-central Beta variate.

See Also

(doubly non-central) t distribution functions, ddnt, pdnt, qdnt, rdnt.

(doubly non-central) Beta distribution functions, ddnbeta, pdnbeta, qdnbeta, rdnbeta.

Examples

Run this code
rv <- rdneta(500, df=100,ncp1=1.5,ncp2=12)
d1 <- ddneta(rv, df=100,ncp1=1.5,ncp2=12)
## Not run: 
# plot(rv,d1)
# ## End(Not run)
p1 <- ddneta(rv, df=100,ncp1=1.5,ncp2=12)
# should be nearly uniform:
## Not run: 
# plot(ecdf(p1))
# ## End(Not run)
q1 <- qdneta(ppoints(length(rv)), df=100,ncp1=1.5,ncp2=12)
## Not run: 
# qqplot(x=rv,y=q1)
# ## End(Not run)

Run the code above in your browser using DataLab