dprodchisqpow: The product of (non-central) chi-squares raised to powers...

View source: R/prodchisqpow.r

prodchisqpowR Documentation

The product of (non-central) chi-squares raised to powers distribution.


Density, distribution function, quantile function and random generation for the distribution of the product of non-central chi-squares taken to powers.


dprodchisqpow(x, df, ncp=0, pow=1, log = FALSE, order.max=5)

pprodchisqpow(q, df, ncp=0, pow=1, lower.tail = TRUE, log.p = FALSE, order.max=5)

qprodchisqpow(p, df, ncp=0, pow=1, lower.tail = TRUE, log.p = FALSE, order.max=5)

rprodchisqpow(n, df, ncp=0, pow=1)


x, q

vector of quantiles.


the vector of degrees of freedom. This is recycled against the ncp, pow, but not against the x,q,p,n.


the vector of non-centrality parameters. This is recycled against the df, pow, but not against the x,q,p,n.


the vector of the power parameters. This is recycled against the df, ncp, but not against the x,q,p,n.


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].


Let X_i \sim \chi^2\left(\delta_i, \nu_i\right) be independently distributed non-central chi-squares, where \nu_i are the degrees of freedom, and \delta_i are the non-centrality parameters. Let p_i be given constants. Suppose

Y = \prod_i X_i^{p_i}.

Then Y follows a product of chi-squares to power distribution.


dprodchisqpow gives the density, pprodchisqpow gives the distribution function, qprodchisqpow gives the quantile function, and rprodchisqpow 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.

The PDQ functions are computed by translation of the sum of log chi-squares distribution functions.


Steven E. Pav shabbychef@gmail.com


Pav, Steven. Moments of the log non-central chi-square distribution. https://arxiv.org/abs/1503.06266

See Also

The sum of log of chi-squares distribution, dsumlogchisq, psumlogchisq, qsumlogchisq, rsumlogchisq, The upsilon distribution, dupsilon, pupsilon, qupsilon, rupsilon. The sum of chi-square powers distribution, dsumchisqpow, psumchisqpow, qsumchisqpow, rsumchisqpow.


df <- c(100,20,10)
ncp <- c(5,3,1)
pow <- c(1,0.5,1)
rvs <- rprodchisqpow(128, df, ncp, pow)
dvs <- dprodchisqpow(rvs, df, ncp, pow)
qvs <- pprodchisqpow(rvs, df, ncp, pow)
pvs <- qprodchisqpow(ppoints(length(rvs)), df, ncp, pow)

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