Learn R Programming

sadists (version 0.2.2)

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)

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 $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

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.

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_ij$ and degrees of freedom $v_ij$ for $i=1,2,...,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. http://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)
## Not run: 
# plot(rv,d1)
# ## End(Not run)
p1 <- pproddnf(rv, df1=df1,df2=df2,ncp1=ncp1,ncp2=ncp2)
# should be nearly uniform:
## Not run: 
# plot(ecdf(p1))
# ## End(Not run)
q1 <- qproddnf(ppoints(length(rv)), df1=df1,df2=df2,ncp1=ncp1,ncp2=ncp2)
## Not run: 
# qqplot(x=rv,y=q1)
# ## End(Not run)

Run the code above in your browser using DataLab