pGC function

Gram-Charlier approximation

Gram-Charlier approximation

Gram-Charlier approximation of the CDF using the first four moments.

pGC(x, moments = c(0, 1, 0, 3), raw = TRUE, lower.tail = TRUE, log.p = FALSE)

Arguments

  • x: Vector of points to approximate the CDF in.
  • moments: The first four raw moments if raw=TRUE. By default the first four raw moments of the standard normal distribution are used. When raw=FALSE, the mean μ=E(X)\mu=E(X), variance σ2=E((Xμ)2)\sigma^2=E((X-\mu)^2), skewness (third standardised moment, ν=E((Xμ)3)/σ3\nu=E((X-\mu)^3)/\sigma^3) and kurtosis (fourth standardised moment, k=E((Xμ)4)/σ4k=E((X-\mu)^4)/\sigma^4).
  • raw: When TRUE (default), the first four raw moments are provided in moments. Otherwise, the mean, variance, skewness and kurtosis are provided in moments.
  • lower.tail: Logical indicating if the probabilities are of the form P(Xx)P(X\le x) (TRUE) or P(X>x)P(X>x) (FALSE). Default is TRUE.
  • log.p: Logical indicating if the probabilities are given as log(p)\log(p), default is FALSE.

Details

Denote the standard normal PDF and CDF respectively by ϕ\phi and Φ\Phi. Let μ\mu be the first moment, σ2=E((Xμ)2)\sigma^2=E((X-\mu)^2) the variance, μ3=E((Xμ)3)\mu_3=E((X-\mu)^3) the third central moment and μ4=E((Xμ)4)\mu_4=E((X-\mu)^4) the fourth central moment of the random variable XX. The corresponding cumulants are given by κ1=μ\kappa_1=\mu, κ2=σ2\kappa_2=\sigma^2, κ3=μ3\kappa_3=\mu_3 and κ4=μ43σ4\kappa_4=\mu_4-3\sigma^4.

Now consider the random variable Z=(Xμ)/σZ=(X-\mu)/\sigma, which has cumulants 0, 1, ν=κ3/σ3\nu=\kappa_3/\sigma^3 and k=κ4/σ4=μ4/σ43k=\kappa_4/\sigma^4=\mu_4/\sigma^4-3.

The Gram-Charlier approximation for the CDF of XX (F(x)F(x)) is given by

F^GC(x)=Φ(z)+ϕ(z)(ν/6h2(z)k/24h3(z)) \hat{F}_{GC}(x) = \Phi(z) + \phi(z) (-\nu/6 h_2(z)- k/24h_3(z))

with h2(z)=z21h_2(z)=z^2-1, h3(z)=z33zh_3(z)=z^3-3z and z=(xμ)/σz=(x-\mu)/\sigma.

See Section 6.2 of Albrecher et al. (2017) for more details.

Returns

Vector of estimates for the probabilities F(x)=P(Xx)F(x)=P(X\le x).

References

Albrecher, H., Beirlant, J. and Teugels, J. (2017). Reinsurance: Actuarial and Statistical Aspects, Wiley, Chichester.

Cheah, P.K., Fraser, D.A.S. and Reid, N. (1993). "Some Alternatives to Edgeworth." The Canadian Journal of Statistics, 21(2), 131--138.

Author(s)

Tom Reynkens

See Also

pEdge, pClas

Examples

# Chi-squared sample X <- rchisq(1000, 2) x <- seq(0, 10, 0.01) # Empirical moments moments = c(mean(X), mean(X^2), mean(X^3), mean(X^4)) p1 <- pGC(x, moments) # Edgeworth approximation p2 <- pEdge(x, moments) # Normal approximation p3 <- pClas(x, mean(X), var(X)) # True probabilities p <- pchisq(x, 2) # Plot true and estimated probabilities plot(x, p, type="l", ylab="F(x)", ylim=c(0,1), col="red") lines(x, p1, lty=2) lines(x, p2, lty=3) lines(x, p3, lty=4, col="blue") legend("bottomright", c("True CDF", "GC approximation", "Edgeworth approximation", "Normal approximation"), col=c("red", "black", "black", "blue"), lty=1:4, lwd=2)
  • Maintainer: Tom Reynkens
  • License: GPL (>= 2)
  • Last published: 2024-12-02