Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pGC

Gram-Charlier approximation


Description

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

Usage

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), variance σ^2=E((X-μ)^2), skewness (third standardised moment, ν=E((X-μ)^3)/σ^3) and kurtosis (fourth standardised moment, k=E((X-μ)^4)/σ^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(X≤ x) (TRUE) or P(X>x) (FALSE). Default is TRUE.

log.p

Logical indicating if the probabilities are given as \log(p), default is FALSE.

Details

Denote the standard normal PDF and CDF respectively by φ and Φ. Let μ be the first moment, σ^2=E((X-μ)^2) the variance, μ_3=E((X-μ)^3) the third central moment and μ_4=E((X-μ)^4) the fourth central moment of the random variable X. The corresponding cumulants are given by κ_1=μ, κ_2=σ^2, κ_3=μ_3 and κ_4=μ_4-3σ^4.

Now consider the random variable Z=(X-μ)/σ, which has cumulants 0, 1, ν=κ_3/σ^3 and k=κ_4/σ^4=μ_4/σ^4-3.

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

\hat{F}_{GC}(x) = Φ(z) + φ(z) (-ν/6 h_2(z)- k/24h_3(z))

with h_2(z)=z^2-1, h_3(z)=z^3-3z and z=(x-μ)/σ.

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

Value

Vector of estimates for the probabilities F(x)=P(X≤ x).

Author(s)

Tom Reynkens

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.

See Also

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

# Gram-Charlier approximation
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)

ReIns

Functions from "Reinsurance: Actuarial and Statistical Aspects"

v1.0.10
GPL (>= 2)
Authors
Tom Reynkens [aut, cre] (<https://orcid.org/0000-0002-5516-5107>), Roel Verbelen [aut] (R code for Mixed Erlang distribution, <https://orcid.org/0000-0002-2347-9240>), Anastasios Bardoutsos [ctb] (Original R code for cEPD estimator), Dries Cornilly [ctb] (Original R code for EVT estimators for truncated data), Yuri Goegebeur [ctb] (Original S-Plus code for basic EVT estimators), Klaus Herrmann [ctb] (Original R code for GPD estimator)
Initial release
2020-05-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.