pClas: Classical estimators for the CDF

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/Approximations.R

Description

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

Usage

1
2
3
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(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

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.

See Also

pEdge, pGC

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 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)

ReIns documentation built on July 2, 2020, 4:03 a.m.