dapx_edgeworth function

Approximate density and distribution via Edgeworth expansion.

Approximate density and distribution via Edgeworth expansion.

Approximate the probability density or cumulative distribution function of a distribution via its raw cumulants.

dapx_edgeworth(x, raw.cumulants, support=c(-Inf,Inf), log=FALSE) papx_edgeworth(q, raw.cumulants, support=c(-Inf,Inf), lower.tail=TRUE, log.p=FALSE)

Arguments

  • x: where to evaluate the approximate density.
  • 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 ff are given as log(f)log(f).
  • q: where to evaluate the approximate distribution.
  • log.p: logical; if TRUE, probabilities p are given as log(p)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

σf(σx)=ϕ(x)+ϕ(x)1sσs{km}Hes+2r(x)ckm,sigmaf(sigmax)=phi(x)+phi(x)sum1<=ssigmassumkmHes+2r(x)ckm, \sigma f(\sigma x) = \phi(x) + \phi(x)\sum_{1 \le s}\sigma^s \sum_{\{k_m\}} He_{s+2r}(x) c_{k_m},sigma f(sigma x) = phi(x) + phi(x) sum_{1 <= s} sigma^s sum_{k_m} He_{s+2r}(x) c_{k_m},

where the second sum is over some partitions, and the constant cc

involves cumulants up to order s+2s+2. Unlike the Gram Charlier expansion, of which it is a rearrangement, the Edgeworth expansion is arranged in increasing powers of the standard deviation sigmasigma.

Note

Monotonicity of the CDF is not guaranteed.

Examples

# normal distribution, for which this is silly xvals <- 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

Author(s)

Steven E. Pav shabbychef@gmail.com

References

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

See Also

the Gram Charlier expansions, dapx_gca, papx_gca

  • Maintainer: Steven E. Pav
  • License: LGPL-3
  • Last published: 2017-03-18