ddneta: The doubly non-central Eta distribution.

View source: R/dneta.r

dnetaR Documentation

The doubly non-central Eta distribution.


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


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)


x, q

vector of quantiles.


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. Note that the sign of ncp1 is important, while ncp2 must be non-negative.


logical; if TRUE, densities f are given as \mbox{log}(f).


the order to use in the approximate density, distribution, and quantile computations, via the Gram-Charlier, Edeworth, or Cornish-Fisher expansion.


vector of probabilities.


number of observations.


logical; if TRUE, probabilities p are given as \mbox{log}(p).


logical; if TRUE (default), probabilities are P[X \le x], otherwise, P[X > x].


Suppose Z is a normal with mean \delta_1, and standard deviation 1, independent of X \sim \chi^2\left(\delta_2,\nu_2\right), a non-central chi-square with \nu_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 \nu_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.


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.


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 shabbychef@gmail.com

See Also

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

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


rv <- rdneta(500, df=100,ncp1=1.5,ncp2=12)
d1 <- ddneta(rv, df=100,ncp1=1.5,ncp2=12)


p1 <- ddneta(rv, df=100,ncp1=1.5,ncp2=12)
# should be nearly uniform:


q1 <- qdneta(ppoints(length(rv)), df=100,ncp1=1.5,ncp2=12)


sadists documentation built on Aug. 22, 2023, 1:06 a.m.