pClas function

Classical estimators for the CDF

Classical estimators for the CDF

Compute approximations of the CDF using the normal approximation, normal-power approximation, shifted Gamma approximation or normal approximation to the shifted Gamma distribution.

pClas(x, mean = 0, variance = 1, skewness = NULL, method = c("normal", "normal-power", "shifted Gamma", "shifted Gamma normal"), lower.tail = TRUE, log.p = FALSE)

Arguments

  • x: Vector of points to approximate the CDF in.
  • mean: Mean of the distribution, default is 0.
  • variance: Variance of the distribution, default is 1.
  • skewness: Skewness coefficient of the distribution, this argument is not used for the normal approximation. Default is NULL meaning no skewness coefficient is provided.
  • method: Approximation method to use, one of "normal", "normal-power", "shifted Gamma" or "shifted Gamma normal". Default is "normal".
  • 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

  • The normal approximation for the CDF of the r.v. XX is defined as
FX(x)Φ((xμ)/σ) F_X(x) \approx \Phi((x-\mu)/\sigma)

where μ\mu and σ2\sigma^2 are the mean and variance of XX, respectively.

  • This approximation can be improved when the skewness parameter
ν=E((Xμ)3)/σ3 \nu=E((X-\mu)^3)/\sigma^3

is available. The normal-power approximation of the CDF is then given by

FX(x)Φ(9/ν2+6z/ν+13/ν) F_X(x) \approx \Phi(\sqrt{9/\nu^2 + 6z/\nu+1}-3/\nu)

for z=(xμ)/σ1z=(x-\mu)/\sigma\ge 1 and 9/ν2+6z/ν+109/\nu^2 + 6z/\nu+1\ge 0.

  • The shifted Gamma approximation uses the approximation
XΓ(4/ν2,2/(ν×σ))+μ2σ/ν. X \approx \Gamma(4/\nu^2, 2/(\nu\times\sigma)) + \mu -2\sigma/\nu.

Here, we need that ν0\nu\>0.

  • The normal approximation to the shifted Gamma distribution approximates the CDF of XX as
FX(x)Φ(16/ν2+8z/ν16/ν21) F_X(x) \approx \Phi(\sqrt{16/\nu^2 + 8z/\nu}-\sqrt{16/\nu^2-1})

for z=(xμ)/σ1z=(x-\mu)/\sigma\ge 1. We need again that ν0\nu\>0.

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.

Author(s)

Tom Reynkens

See Also

pEdge, pGC

Examples

# Chi-squared sample X <- rchisq(1000, 2) x <- seq(0, 10, 0.01) # Classical approximations p1 <- pClas(x, mean(X), var(X)) p2 <- pClas(x, mean(X), var(X), mean((X-mean(X))^3)/sd(X)^3, method="normal-power") p3 <- pClas(x, mean(X), var(X), mean((X-mean(X))^3)/sd(X)^3, method="shifted Gamma") p4 <- pClas(x, mean(X), var(X), mean((X-mean(X))^3)/sd(X)^3, method="shifted Gamma normal") # 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, col="green") lines(x, p3, lty=4) lines(x, p4, lty=5, col="blue") legend("bottomright", c("True CDF", "normal approximation", "normal-power approximation", "shifted Gamma approximation", "shifted Gamma normal approximation"), lty=1:5, col=c("red", "black", "green", "black", "blue"), lwd=2)
  • Maintainer: Tom Reynkens
  • License: GPL (>= 2)
  • Last published: 2024-12-02