50% off | Unlimited Data & AI Learning

Last chance! 50% off unlimited learning

Sale ends in


sadists (version 0.2.5)

proddnf: The product of multiple doubly non-central F's distribution.

Description

Density, distribution function, quantile function and random generation for the product of multiple independent doubly non-central F variates.

Usage

dproddnf(x, df1, df2, ncp1, ncp2, log = FALSE, order.max=4)

pproddnf(q, df1, df2, ncp1, ncp2, lower.tail = TRUE, log.p = FALSE, order.max=4)

qproddnf(p, df1, df2, ncp1, ncp2, lower.tail = TRUE, log.p = FALSE, order.max=4)

rproddnf(n, df1, df2, ncp1, ncp2)

Value

dproddnf gives the density, pproddnf gives the distribution function, qproddnf gives the quantile function, and rproddnf generates random deviates.

Invalid arguments will result in return value NaN with a warning.

Arguments

x, q

vector of quantiles.

df1, df2

the vectors of the degrees of freedom for the numerator and denominator. We do not recycle these versus the x,q,p,n.

ncp1, ncp2

the vectors of 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 \(\mbox{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 \(\mbox{log}(p)\).

lower.tail

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

Author

Steven E. Pav shabbychef@gmail.com

Details

Let $$x_j \sim F\left(\delta_{1,j},\delta_{2,j},\nu_{1,j},\nu_{2,j}\right)$$ be independent doubly non-central F variates with non-centrality parameters \(\delta_{i,j}\) and degrees of freedom \(\nu_{i,j}\) for \(i=1,2,\ldots,I\) and \(j=1,2\). Then $$Y = \prod_j x_j$$ takes a product of doubly non-central F's distribution. We take the parameters of this distribution as the four \(I\) length vectors of the two degrees of freedom and the two non-centrality parameters.

References

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. (doubly non-central) F distribution functions, ddnf, pdnf, qdnf, rdnf.

Examples

Run this code
df1 <- c(10,20,5)
df2 <- c(1000,500,150)
ncp1 <- c(1,0,2.5)
ncp2 <- c(0,1.5,5)

rv <- rproddnf(500, df1=df1,df2=df2,ncp1=ncp1,ncp2=ncp2)
d1 <- dproddnf(rv, df1=df1,df2=df2,ncp1=ncp1,ncp2=ncp2)
# \donttest{
plot(rv,d1)
# }
p1 <- pproddnf(rv, df1=df1,df2=df2,ncp1=ncp1,ncp2=ncp2)
# should be nearly uniform:
# \donttest{
plot(ecdf(p1))
# }
q1 <- qproddnf(ppoints(length(rv)), df1=df1,df2=df2,ncp1=ncp1,ncp2=ncp2)
# \donttest{
qqplot(x=rv,y=q1)
# }

Run the code above in your browser using DataLab