raw.cumulants: an atomic array of the 1st through kth raw cumulants of the probability distribution. The first cumulant is the mean, the second is the variance. The third is not the typical unitless skew.
support: the support of the density function. It is assumed that the density is zero on the complement of this open interval.
log: logical; if TRUE, densities f are given as log(f).
q: where to evaluate the approximate distribution.
log.p: logical; if TRUE, probabilities p are given as log(p).
lower.tail: whether to compute the lower tail. If false, we approximate the survival function.
Returns
The approximate density at x, or the approximate CDF at q.
Details
Given the raw cumulants of a probability distribution, we can approximate the probability density function, or the cumulative distribution function, via an Edgeworth expansion on the standardized distribution. The derivation of the Edgeworth expansion is rather more complicated than that of the Gram Charlier approximation, involving the characteristic function and an expression of the higher order derivatives of the composition of functions; see Blinnikov and Moessner for more details. The Edgeworth expansion can be expressed succinctly as
where the second sum is over some partitions, and the constant c
involves cumulants up to order s+2. Unlike the Gram Charlier expansion, of which it is a rearrangement, the Edgeworth expansion is arranged in increasing powers of the standard deviation sigma.
Note
Monotonicity of the CDF is not guaranteed.
Examples
# normal distribution, for which this is sillyxvals <- seq(-2,2,length.out=501)d1 <- dapx_edgeworth(xvals, c(0,1,0,0,0,0))d2 <- dnorm(xvals)d1 - d2
qvals <- seq(-2,2,length.out=501)p1 <- papx_edgeworth(qvals, c(0,1,0,0,0,0))p2 <- pnorm(qvals)p1 - p2
S. Blinnikov and R. Moessner. "Expansions for nearly Gaussian distributions." Astronomy and Astrophysics Supplement 130 (1998): 193-205. http://arxiv.org/abs/astro-ph/9711239