Learn R Programming

PDQutils (version 0.1.6)

qapx_cf: Approximate quantile via Cornish-Fisher expansion.

Description

Approximate the quantile function of a distribution via its cumulants.

Usage

qapx_cf(p, raw.cumulants, support=c(-Inf,Inf), lower.tail = TRUE, log.p = FALSE)

Arguments

p
where to evaluate the approximate distribution.
raw.cumulants
an atomic array of the 1st through kth raw cumulants. The first value is the mean of the distribution, the second should be the variance of the distribution, the remainder are raw cumulants.
support
the support of the density function. It is assumed that the density is zero on the complement of this open interval. This defaults to c(-Inf,Inf) for the normal basis, c(0,Inf) for the gamma basis, and c(0,1) for the Beta, and c(-1,1) for the arcsine and wigner.
lower.tail
whether to compute the lower tail. If false, we approximate the survival function.
log.p
logical; if TRUE, probabilities p are given as \(\mbox{log}(p)\).

Value

The approximate quantile at p.

Details

Given the cumulants of a probability distribution, we approximate the quantile function via a Cornish-Fisher expansion.

References

Lee, Y-S., and Lin, T-K. "Algorithm AS269: High Order Cornish Fisher Expansion." Appl. Stat. 41, no. 1 (1992): 233-240. http://www.jstor.org/stable/2347649 Lee, Y-S., and Lin, T-K. "Correction to Algorithm AS269: High Order Cornish Fisher Expansion." Appl. Stat. 42, no. 1 (1993): 268-269. http://www.jstor.org/stable/2347433 AS 269. http://lib.stat.cmu.edu/apstat/269 Jaschke, Stefan R. "The Cornish-Fisher-expansion in the context of Delta-Gamma-normal approximations." No. 2001, 54. Discussion Papers, Interdisciplinary Research Project 373: Quantification and Simulation of Economic Processes, 2001. http://www.jaschke-net.de/papers/CoFi.pdf

See Also

dapx_gca, papx_gca, AS269, rapx_cf

Examples

Run this code
# normal distribution:
pvals <- seq(0.001,0.999,length.out=501)
q1 <- qapx_cf(pvals, c(0,1,0,0,0,0,0))
q2 <- qnorm(pvals)
q1 - q2

Run the code above in your browser using DataLab