Title: | Estimate the Probability in the Upper Tail of the Aggregate Loss Distribution |
---|---|
Description: | Set of tools to estimate the probability in the upper tail of the aggregate loss distribution using different methods: Panjer recursion, Monte Carlo simulations, Markov bound, Cantelli bound, Moment bound, and Chernoff bound. |
Authors: | Isabella Gollini [aut, cre], Jonathan Rougier [ctb] |
Maintainer: | Isabella Gollini <[email protected]> |
License: | GPL-2 | GPL-3 |
Version: | 1.0 |
Built: | 2025-02-23 05:16:47 UTC |
Source: | https://github.com/igollini/tailloss |
Evaluate the probability in the upper tail of the aggregate loss distribution using different methods: Panjer recursion, Monte Carlo simulations, Markov bound, Cantelli bound, Moment bound, and Chernoff bound.
The package tailloss
contains functions to estimate the exceedance probability curve of the aggregated losses. There are two ‘exact’ approaches: Panjer recursion and Monte Carlo simulations, and four approaches producing upper bounds: the Markov bound, the Cantelli bound, the Moment bound, and the Chernoff bound. The upper bounds are useful and effective when the number of events in the catalogue is large, and there is interest in estimating the exceedance probabilities of exceptionally high losses.
Isabella Gollini <[email protected]>, and Jonathan Rougier.
This work was supported by the Natural Environment Research Council [Consortium on Risk in the Environment: Diagnostics, Integration, Benchmarking, Learning and Elicitation (CREDIBLE); grant number NE/J017450/1]
Gollini, I., and Rougier, J. C. (2015), "Rapidly bounding the exceedance probabilities of high aggregate losses", http://arxiv.org/abs/1507.01853.
data(UShurricane) # Compress the table to millions of dollars USh.m <- compressELT(ELT(UShurricane), digits = -6) s <- seq(1,40) EPC <- matrix(NA, length(s), 6) colnames(EPC) <- c("Panjer", "MonteCarlo", "Markov", "Cantelli", "Moment", "Chernoff") EPC[, 1] <- fPanjer(USh.m, s = s)[, 2] EPC[, 2] <- fMonteCarlo(USh.m, s = s)[, 2] EPC[, 3] <- fMarkov(USh.m, s = s)[, 2] EPC[, 4] <- fCantelli(USh.m, s = s)[, 2] EPC[, 5] <- fMoment(USh.m, s = s)[, 2] EPC[, 6] <- fChernoff(USh.m, s = s)[, 2] matplot(s, EPC, type = "l", lwd = 2, xlab = "s", ylim = c(0, 1), lty = 1:6, ylab = expression(plain(Pr)(S>=s)), main = "Exceedance Probability Curve") zoombox(s, EPC, x0 = c(30, 40), y0 = c(0, .1), y1 = c(.3, .6), type = "l", lwd = 2, lty = 1:6) legend("topright", legend = colnames(EPC), lty = 1:6, col = 1:6, lwd = 2) EPCcap <- matrix(NA, length(s), 6) colnames(EPCcap) <- c("Panjer", "MonteCarlo", "Markov", "Cantelli", "Moment", "Chernoff") EPCcap[, 1] <- fPanjer(USh.m, s = s, theta = 2, cap = 5)[, 2] EPCcap[, 2] <- fMonteCarlo(USh.m, s = s, theta = 2, cap = 5)[, 2] EPCcap[, 3] <- fMarkov(USh.m, s = s, theta = 2, cap = 5)[, 2] EPCcap[, 4] <- fCantelli(USh.m, s = s, theta = 2, cap = 5)[, 2] EPCcap[, 5] <- fMoment(USh.m, s = s, theta = 2, cap = 5)[, 2] EPCcap[, 6] <- fChernoff(USh.m, s = s, theta = 2, cap = 5)[, 2] matplot(s, EPCcap, type = "l", lwd = 2, xlab = "s", ylim = c(0, 1), lty = 1:6, ylab = expression(plain(Pr)(S>=s)), main = "Exceedance Probability Curve") zoombox(s, EPCcap, x0 = c(30, 40), y0 = c(0, .1), y1 = c(.3, .6), type = "l", lwd = 2, lty = 1:6) legend("topright", legend = colnames(EPC), lty = 1:6, col = 1:6, lwd = 2)
data(UShurricane) # Compress the table to millions of dollars USh.m <- compressELT(ELT(UShurricane), digits = -6) s <- seq(1,40) EPC <- matrix(NA, length(s), 6) colnames(EPC) <- c("Panjer", "MonteCarlo", "Markov", "Cantelli", "Moment", "Chernoff") EPC[, 1] <- fPanjer(USh.m, s = s)[, 2] EPC[, 2] <- fMonteCarlo(USh.m, s = s)[, 2] EPC[, 3] <- fMarkov(USh.m, s = s)[, 2] EPC[, 4] <- fCantelli(USh.m, s = s)[, 2] EPC[, 5] <- fMoment(USh.m, s = s)[, 2] EPC[, 6] <- fChernoff(USh.m, s = s)[, 2] matplot(s, EPC, type = "l", lwd = 2, xlab = "s", ylim = c(0, 1), lty = 1:6, ylab = expression(plain(Pr)(S>=s)), main = "Exceedance Probability Curve") zoombox(s, EPC, x0 = c(30, 40), y0 = c(0, .1), y1 = c(.3, .6), type = "l", lwd = 2, lty = 1:6) legend("topright", legend = colnames(EPC), lty = 1:6, col = 1:6, lwd = 2) EPCcap <- matrix(NA, length(s), 6) colnames(EPCcap) <- c("Panjer", "MonteCarlo", "Markov", "Cantelli", "Moment", "Chernoff") EPCcap[, 1] <- fPanjer(USh.m, s = s, theta = 2, cap = 5)[, 2] EPCcap[, 2] <- fMonteCarlo(USh.m, s = s, theta = 2, cap = 5)[, 2] EPCcap[, 3] <- fMarkov(USh.m, s = s, theta = 2, cap = 5)[, 2] EPCcap[, 4] <- fCantelli(USh.m, s = s, theta = 2, cap = 5)[, 2] EPCcap[, 5] <- fMoment(USh.m, s = s, theta = 2, cap = 5)[, 2] EPCcap[, 6] <- fChernoff(USh.m, s = s, theta = 2, cap = 5)[, 2] matplot(s, EPCcap, type = "l", lwd = 2, xlab = "s", ylim = c(0, 1), lty = 1:6, ylab = expression(plain(Pr)(S>=s)), main = "Exceedance Probability Curve") zoombox(s, EPCcap, x0 = c(30, 40), y0 = c(0, .1), y1 = c(.3, .6), type = "l", lwd = 2, lty = 1:6) legend("topright", legend = colnames(EPC), lty = 1:6, col = 1:6, lwd = 2)
Function to merge losses of the same amount adding up their corresponding occurrence rates, and to round the losses to the 10^digits
integer value.
compressELT(ELT, digits = 0)
compressELT(ELT, digits = 0)
ELT |
Data frame containing two numeric columns. The column |
digits |
Integer. It specifies the rounding of the losses to the 10^ |
Data frame containg two numeric columns. The column Loss
contains the expected losses from each single occurrence of event. The column Rate
contains the arrival rates of a single occurrence of event.
data(UShurricane) # Compress the table to thousands of dollars USh.k <- compressELT(ELT(UShurricane), digits = -3) summary(USh.k) # Compress the table to millions of dollars USh.m <- compressELT(ELT(UShurricane), digits = -6) summary(USh.m)
data(UShurricane) # Compress the table to thousands of dollars USh.k <- compressELT(ELT(UShurricane), digits = -3) summary(USh.k) # Compress the table to millions of dollars USh.m <- compressELT(ELT(UShurricane), digits = -6) summary(USh.m)
Function to create an ELT object
ELT(X = NULL, Rate = NULL, Loss = NULL, ID = NULL)
ELT(X = NULL, Rate = NULL, Loss = NULL, ID = NULL)
X |
Data frame containing at least two numeric columns. The column |
Rate |
Positive numeric vector of arrival rates |
Loss |
Positive numeric vector of losses |
ID |
Vector event ID. |
An object ELT, a data frame with 3 columns. The column ID
contains the ID of each event. The column Rate
contains the arrival rates of a single occurrence of event. The column Loss
contains the expected losses from each single occurrence of event.
rate <- c(.1, .02, .05) loss <- c(2, 5, 7) ELT(Rate = rate, Loss = loss) # Same as rl <- data.frame(Rate = rate, Loss = loss) ELT(rl)
rate <- c(.1, .02, .05) loss <- c(2, 5, 7) ELT(Rate = rate, Loss = loss) # Same as rl <- data.frame(Rate = rate, Loss = loss) ELT(rl)
Function to bound the total losses via the Cantelli inequality.
fCantelli(ELT, s, t = 1, theta = 0, cap = Inf)
fCantelli(ELT, s, t = 1, theta = 0, cap = Inf)
ELT |
Data frame containing two numeric columns. The column |
s |
Scalar or numeric vector containing the total losses of interest. |
t |
Scalar representing the time period of interest. The default value is |
theta |
Scalar containing information about the variance of the Gamma distribution: |
cap |
Scalar representing the level of truncation of the Gamma distribution, i.e. the maximum possible loss caused by a single event. The default value is |
Cantelli's inequality states:
where and
are the mean and the variance of the distribution of
.
A numeric matrix, containing the pre-specified losses s
in the first column and the upper bound for the exceedance probabilities in the second column.
data(UShurricane) # Compress the table to millions of dollars USh.m <- compressELT(ELT(UShurricane), digits = -6) EPC.Cantelli <- fCantelli(USh.m, s = 1:40) plot(EPC.Cantelli, type = "l", ylim = c(0, 1)) # Assuming the losses follow a Gamma with E[X] = x, and Var[X] = 2 * x EPC.Cantelli.Gamma <- fCantelli(USh.m, s = 1:40, theta = 2, cap = 25) EPC.Cantelli.Gamma plot(EPC.Cantelli.Gamma, type = "l") # Compare the two results: plot(EPC.Cantelli, type = "l", main = "Exceedance Probability Curve", ylim = c(0, 1)) lines(EPC.Cantelli.Gamma, col = 2, lty = 2) legend("topright", c("Dirac Delta", expression(paste("Gamma(", alpha[i] == 1 / theta^2, ", ", beta[i] ==1 / (x[i] * theta^2), ")", " cap =", 5))), lwd = 2, lty = 1:2, col = 1:2)
data(UShurricane) # Compress the table to millions of dollars USh.m <- compressELT(ELT(UShurricane), digits = -6) EPC.Cantelli <- fCantelli(USh.m, s = 1:40) plot(EPC.Cantelli, type = "l", ylim = c(0, 1)) # Assuming the losses follow a Gamma with E[X] = x, and Var[X] = 2 * x EPC.Cantelli.Gamma <- fCantelli(USh.m, s = 1:40, theta = 2, cap = 25) EPC.Cantelli.Gamma plot(EPC.Cantelli.Gamma, type = "l") # Compare the two results: plot(EPC.Cantelli, type = "l", main = "Exceedance Probability Curve", ylim = c(0, 1)) lines(EPC.Cantelli.Gamma, col = 2, lty = 2) legend("topright", c("Dirac Delta", expression(paste("Gamma(", alpha[i] == 1 / theta^2, ", ", beta[i] ==1 / (x[i] * theta^2), ")", " cap =", 5))), lwd = 2, lty = 1:2, col = 1:2)
Function to bound the total losses via the Chernoff inequality.
fChernoff(ELT, s, t = 1, theta = 0, cap = Inf, nk = 1001, verbose = FALSE)
fChernoff(ELT, s, t = 1, theta = 0, cap = Inf, nk = 1001, verbose = FALSE)
ELT |
Data frame containing two numeric columns. The column |
s |
Scalar or numeric vector containing the total losses of interest. |
t |
Scalar representing the time period of interest. The default value is |
theta |
Scalar containing information about the variance of the Gamma distribution: |
cap |
Scalar representing the financial cap on losses for a single event, i.e. the maximum possible loss caused by a single event. The default value is |
nk |
Number of optimisation points. |
verbose |
Logical. If |
Chernoff's inequality states:
where is the Moment Generating Function (MGF) of the total loss S.
The
fChernoff
function optimises the bound over a fixed set of nk
discrete values.
A numeric matrix, containing the pre-specified losses s
in the first column and the upper bound for the exceedance probabilities in the second column.
data(UShurricane) # Compress the table to millions of dollars USh.m <- compressELT(ELT(UShurricane), digits = -6) EPC.Chernoff <- fChernoff(USh.m, s = 1:40) EPC.Chernoff plot(EPC.Chernoff, type = "l", ylim = c(0, 1)) # Assuming the losses follow a Gamma with E[X] = x, and Var[X] = 2 * x EPC.Chernoff.Gamma <- fChernoff(USh.m, s = 1:40, theta = 2, cap = 5) EPC.Chernoff.Gamma plot(EPC.Chernoff.Gamma, type = "l", ylim = c(0, 1)) # Compare the two results: plot(EPC.Chernoff, type = "l", main = "Exceedance Probability Curve", ylim = c(0, 1)) lines(EPC.Chernoff.Gamma, col = 2, lty = 2) legend("topright", c("Dirac Delta", expression(paste("Gamma(", alpha[i] == 1 / theta^2, ", ", beta[i] ==1 / (x[i] * theta^2), ")", " cap =", 5))), lwd = 2, lty = 1:2, col = 1:2)
data(UShurricane) # Compress the table to millions of dollars USh.m <- compressELT(ELT(UShurricane), digits = -6) EPC.Chernoff <- fChernoff(USh.m, s = 1:40) EPC.Chernoff plot(EPC.Chernoff, type = "l", ylim = c(0, 1)) # Assuming the losses follow a Gamma with E[X] = x, and Var[X] = 2 * x EPC.Chernoff.Gamma <- fChernoff(USh.m, s = 1:40, theta = 2, cap = 5) EPC.Chernoff.Gamma plot(EPC.Chernoff.Gamma, type = "l", ylim = c(0, 1)) # Compare the two results: plot(EPC.Chernoff, type = "l", main = "Exceedance Probability Curve", ylim = c(0, 1)) lines(EPC.Chernoff.Gamma, col = 2, lty = 2) legend("topright", c("Dirac Delta", expression(paste("Gamma(", alpha[i] == 1 / theta^2, ", ", beta[i] ==1 / (x[i] * theta^2), ")", " cap =", 5))), lwd = 2, lty = 1:2, col = 1:2)
Function to bound the total losses via the Markov inequality.
fMarkov(ELT, s, t = 1, theta = 0, cap = Inf)
fMarkov(ELT, s, t = 1, theta = 0, cap = Inf)
ELT |
Data frame containing two numeric columns. The column |
s |
Scalar or numeric vector containing the total losses of interest. |
t |
Scalar representing the time period of interest. The default value is |
theta |
Scalar containing information about the variance of the Gamma distribution: |
cap |
Scalar representing the financial cap on losses for a single event, i.e. the maximum possible loss caused by a single event. The default value is |
Cantelli's inequality states:
A numeric matrix, containing the pre-specified losses s
in the first column and the upper bound for the exceedance probabilities in the second column.
data(UShurricane) # Compress the table to millions of dollars USh.m <- compressELT(ELT(UShurricane), digits = -6) EPC.Markov <- fMarkov(USh.m, s = 1:40) plot(EPC.Markov, type = "l", ylim = c(0, 1)) # Assuming the losses follow a Gamma with E[X] = x, and Var[X] = 2 * x EPC.Markov.Gamma <- fMarkov(USh.m, s = 1:40, theta = 2, cap = 5) EPC.Markov.Gamma plot(EPC.Markov.Gamma, type = "l", ylim = c(0, 1)) # Compare the two results: plot(EPC.Markov, type = "l", main = "Exceedance Probability Curve", ylim = c(0,1)) lines(EPC.Markov.Gamma, col = 2, lty = 2) legend("topright", c("Dirac Delta", expression(paste("Gamma(", alpha[i] == 1 / theta^2, ", ", beta[i] ==1 / (x[i] * theta^2), ")", " cap =", 5))), lwd = 2, lty = 1:2, col = 1:2)
data(UShurricane) # Compress the table to millions of dollars USh.m <- compressELT(ELT(UShurricane), digits = -6) EPC.Markov <- fMarkov(USh.m, s = 1:40) plot(EPC.Markov, type = "l", ylim = c(0, 1)) # Assuming the losses follow a Gamma with E[X] = x, and Var[X] = 2 * x EPC.Markov.Gamma <- fMarkov(USh.m, s = 1:40, theta = 2, cap = 5) EPC.Markov.Gamma plot(EPC.Markov.Gamma, type = "l", ylim = c(0, 1)) # Compare the two results: plot(EPC.Markov, type = "l", main = "Exceedance Probability Curve", ylim = c(0,1)) lines(EPC.Markov.Gamma, col = 2, lty = 2) legend("topright", c("Dirac Delta", expression(paste("Gamma(", alpha[i] == 1 / theta^2, ", ", beta[i] ==1 / (x[i] * theta^2), ")", " cap =", 5))), lwd = 2, lty = 1:2, col = 1:2)
Function to bound the total losses via the Moment inequality.
fMoment(ELT, s, t = 1, theta = 0, cap = Inf, verbose = FALSE)
fMoment(ELT, s, t = 1, theta = 0, cap = Inf, verbose = FALSE)
ELT |
Data frame containing two numeric columns. The column |
s |
Scalar or numeric vector containing the total losses of interest. |
t |
Scalar representing the time period of interest. The default value is |
theta |
Scalar containing information about the variance of the Gamma distribution: |
cap |
Scalar representing the financial cap on losses for a single event, i.e. the maximum possible loss caused by a single event. The default value is |
verbose |
Logical. If |
Moment inequality states:
where is the
-th moment of the total loss
distribution.
A numeric matrix, containing the pre-specified losses s
in the first column and the upper bound for the exceedance probabilities in the second column.
data(UShurricane) # Compress the table to millions of dollars USh.m <- compressELT(ELT(UShurricane), digits = -6) EPC.Moment <- fMoment(USh.m, s = 1:40) EPC.Moment plot(EPC.Moment, type = "l", ylim = c(0, 1)) # Assuming the losses follow a Gamma with E[X] = x, and Var[X] = 2 * x EPC.Moment.Gamma <- fMoment(USh.m, s = 1:40, theta = 2, cap = 5) EPC.Moment.Gamma plot(EPC.Moment.Gamma, type = "l", ylim = c(0, 1)) # Compare the two results: plot(EPC.Moment, type = "l", main = "Exceedance Probability Curve", ylim = c(0, 1)) lines(EPC.Moment.Gamma, col = 2, lty = 2) legend("topright", c("Dirac Delta", expression(paste("Gamma(", alpha[i] == 1 / theta^2, ", ", beta[i] ==1 / (x[i] * theta^2), ")", " cap =", 5))), lwd = 2, lty = 1:2, col = 1:2)
data(UShurricane) # Compress the table to millions of dollars USh.m <- compressELT(ELT(UShurricane), digits = -6) EPC.Moment <- fMoment(USh.m, s = 1:40) EPC.Moment plot(EPC.Moment, type = "l", ylim = c(0, 1)) # Assuming the losses follow a Gamma with E[X] = x, and Var[X] = 2 * x EPC.Moment.Gamma <- fMoment(USh.m, s = 1:40, theta = 2, cap = 5) EPC.Moment.Gamma plot(EPC.Moment.Gamma, type = "l", ylim = c(0, 1)) # Compare the two results: plot(EPC.Moment, type = "l", main = "Exceedance Probability Curve", ylim = c(0, 1)) lines(EPC.Moment.Gamma, col = 2, lty = 2) legend("topright", c("Dirac Delta", expression(paste("Gamma(", alpha[i] == 1 / theta^2, ", ", beta[i] ==1 / (x[i] * theta^2), ")", " cap =", 5))), lwd = 2, lty = 1:2, col = 1:2)
Function to estimate the total losses via the Monte Carlo simulations.
fMonteCarlo(ELT, s, t = 1, theta = 0, cap = Inf, nsim = 10000, verbose = FALSE)
fMonteCarlo(ELT, s, t = 1, theta = 0, cap = Inf, nsim = 10000, verbose = FALSE)
ELT |
Data frame containing two numeric columns. The column |
s |
Scalar or numeric vector containing the total losses of interest. |
t |
Scalar representing the time period of interest. The default value is |
theta |
Scalar containing information about the variance of the Gamma distribution: |
cap |
Scalar representing the financial cap on losses for a single event, i.e. the maximum possible loss caused by a single event. The default value is |
nsim |
Integer representing the number of Monte Carlo simulations. The default value is |
verbose |
Logical, if |
If verbose = FALSE
the function returns a numeric matrix, containing in the first column the pre-specified losses s
, and the estimated exceedance probabilities in the second column.
If verbose = TRUE
the function returns a numeric matrix containing four columns. The first column contains the losses s
, the second column contains the estimated exceedance probabilities, the other columns contain the 95% confidence bands. The attributes of this matrix are a vector simS
containing the simulated losses.
data(UShurricane) # Compress the table to millions of dollars USh.m <- compressELT(ELT(UShurricane), digits = -6) EPC.MonteCarlo <- fMonteCarlo(USh.m, s = 1:40, verbose = TRUE) EPC.MonteCarlo par(mfrow = c(1, 2)) plot(EPC.MonteCarlo[, 1:2], type = "l", ylim = c(0, 1)) matlines(EPC.MonteCarlo[, -2], ylim = c(0, 1), lty = 2, col = 1) # Assuming the losses follow a Gamma with E[X] = x, and Var[X] = 2 * x and cap = 5m EPC.MonteCarlo.Gamma <- fMonteCarlo(USh.m, s = 1:40, theta = 2, cap = 5, verbose = TRUE) EPC.MonteCarlo.Gamma plot(EPC.MonteCarlo.Gamma[, 1:2], type = "l", ylim = c(0, 1)) matlines(EPC.MonteCarlo.Gamma[, -2], ylim = c(0,1), lty = 2, col = 1) # Compare the two results: par(mfrow = c(1, 1)) plot(EPC.MonteCarlo[, 1:2], type = "l", main = "Exceedance Probability Curve", ylim = c(0, 1)) lines(EPC.MonteCarlo.Gamma[, 1:2], col = 2, lty = 2) legend("topright", c("Dirac Delta", expression(paste("Gamma(", alpha[i] == 1 / theta^2, ", ", beta[i] ==1 / (x[i] * theta^2), ")", " cap =", 5))), lwd = 2, lty = 1:2, col = 1:2)
data(UShurricane) # Compress the table to millions of dollars USh.m <- compressELT(ELT(UShurricane), digits = -6) EPC.MonteCarlo <- fMonteCarlo(USh.m, s = 1:40, verbose = TRUE) EPC.MonteCarlo par(mfrow = c(1, 2)) plot(EPC.MonteCarlo[, 1:2], type = "l", ylim = c(0, 1)) matlines(EPC.MonteCarlo[, -2], ylim = c(0, 1), lty = 2, col = 1) # Assuming the losses follow a Gamma with E[X] = x, and Var[X] = 2 * x and cap = 5m EPC.MonteCarlo.Gamma <- fMonteCarlo(USh.m, s = 1:40, theta = 2, cap = 5, verbose = TRUE) EPC.MonteCarlo.Gamma plot(EPC.MonteCarlo.Gamma[, 1:2], type = "l", ylim = c(0, 1)) matlines(EPC.MonteCarlo.Gamma[, -2], ylim = c(0,1), lty = 2, col = 1) # Compare the two results: par(mfrow = c(1, 1)) plot(EPC.MonteCarlo[, 1:2], type = "l", main = "Exceedance Probability Curve", ylim = c(0, 1)) lines(EPC.MonteCarlo.Gamma[, 1:2], col = 2, lty = 2) legend("topright", c("Dirac Delta", expression(paste("Gamma(", alpha[i] == 1 / theta^2, ", ", beta[i] ==1 / (x[i] * theta^2), ")", " cap =", 5))), lwd = 2, lty = 1:2, col = 1:2)
Function to calculate the total losses via the Panjer recursion.
fPanjer(ELT, s, t = 1, theta = 0, cap = Inf, nq = 10, verbose = FALSE)
fPanjer(ELT, s, t = 1, theta = 0, cap = Inf, nq = 10, verbose = FALSE)
ELT |
Data frame containing two numeric columns. The column |
s |
Scalar or numeric vector containing the total losses of interest. |
t |
Scalar representing the time period of interest. The default value is |
theta |
Scalar containing information about the variance of the Gamma distribution: |
cap |
Scalar representing the financial cap on losses for a single event, i.e. the maximum possible loss caused by a single event. The default value is |
nq |
Scalar, number of quantiles added when |
verbose |
A logical, if |
A numeric matrix containing the pre-specified losses s
in the first column and the exceedance probabilities in the second column.
Panjer, H.H. (1980), ‘The aggregate claims distribution and stop-loss reinsurance,’ Transactions of the Society of Actuaries, 32, 523-545.
data(UShurricane) # Compress the table to millions of dollars USh.m <- compressELT(ELT(UShurricane), digits = -6) EPC.Panjer <- fPanjer(USh.m, s = 1:40, verbose = TRUE) EPC.Panjer plot(EPC.Panjer, type = "l", ylim = c(0,1)) # Assuming the losses follow a Gamma with E[X] = x, and Var[X] = 2 * x and cap = 5m EPC.Panjer.Gamma <- fPanjer(USh.m, s = 1:40, theta = 2, cap = 5, verbose = TRUE) EPC.Panjer.Gamma plot(EPC.Panjer.Gamma, type = "l", ylim = c(0,1)) # Compare the two results: plot(EPC.Panjer, type = "l", main = 'Exceedance Probability Curve', ylim = c(0, 1)) lines(EPC.Panjer.Gamma, col = 2, lty = 2) legend("topright", c("Dirac Delta", expression(paste("Gamma(", alpha[i] == 1 / theta^2, ", ", beta[i] ==1 / (x[i] * theta^2), ")", " cap =", 5))), lwd = 2, lty = 1:2, col = 1:2)
data(UShurricane) # Compress the table to millions of dollars USh.m <- compressELT(ELT(UShurricane), digits = -6) EPC.Panjer <- fPanjer(USh.m, s = 1:40, verbose = TRUE) EPC.Panjer plot(EPC.Panjer, type = "l", ylim = c(0,1)) # Assuming the losses follow a Gamma with E[X] = x, and Var[X] = 2 * x and cap = 5m EPC.Panjer.Gamma <- fPanjer(USh.m, s = 1:40, theta = 2, cap = 5, verbose = TRUE) EPC.Panjer.Gamma plot(EPC.Panjer.Gamma, type = "l", ylim = c(0,1)) # Compare the two results: plot(EPC.Panjer, type = "l", main = 'Exceedance Probability Curve', ylim = c(0, 1)) lines(EPC.Panjer.Gamma, col = 2, lty = 2) legend("topright", c("Dirac Delta", expression(paste("Gamma(", alpha[i] == 1 / theta^2, ", ", beta[i] ==1 / (x[i] * theta^2), ")", " cap =", 5))), lwd = 2, lty = 1:2, col = 1:2)
Summary statistics for class ELT.
## S3 method for class 'ELT' summary(object, theta = 0, cap = Inf, t = 1, ...)
## S3 method for class 'ELT' summary(object, theta = 0, cap = Inf, t = 1, ...)
object |
An object of class |
theta |
Scalar containing information about the variance of the Gamma distribution: |
cap |
Scalar representing the financial cap on losses for a single event, i.e. the maximum possible loss caused by a single event. The default value is |
t |
Scalar representing the time period of interest. The default value is |
... |
additional arguments affecting the summary produced. |
A list containing the data summary, and the means and the standard deviations of ,
, and
.
data(UShurricane) summary(ELT(UShurricane))
data(UShurricane) summary(ELT(UShurricane))
US hurricane data provided by Peter Taylor and Dickie Whitaker.
Data frame with 32060 rows and 3 columns
EventID. ID of 32060 events.
Rate. Annual rate of occurrence.
Loss. Loss associated to each event measured in $.
Function for zooming onto a matplot(x, y, ...)
.
zoombox(x, y, x0, y0 = c(0, 0.05), y1 = c(0.1, 0.6), ...)
zoombox(x, y, x0, y0 = c(0, 0.05), y1 = c(0.1, 0.6), ...)
x , y
|
Vectors or matrices of data for plotting. The number of rows should match. If one of them are missing, the other is taken as y and an x vector of 1:n is used. Missing values (NAs) are allowed. |
x0 |
range of x to zoom on. |
y0 |
range of y to zoom on. The default value is |
y1 |
range of y where to put the zoomed area. The default value is |
... |
Arguments to be passed to methods, such as graphical parameters (see |
data(UShurricane) # Compress the table to millions of dollars USh.m <- compressELT(ELT(UShurricane), digits = -6) s <- seq(1,40) EPC <- matrix(NA, length(s), 6) colnames(EPC) <- c("Panjer", "MonteCarlo", "Markov", "Cantelli", "Moment", "Chernoff") EPC[, 1] <- fPanjer(USh.m, s = s)[, 2] EPC[, 2] <- fMonteCarlo(USh.m, s = s)[, 2] EPC[, 3] <- fMarkov(USh.m, s = s)[, 2] EPC[, 4] <- fCantelli(USh.m, s = s)[, 2] EPC[, 5] <- fMoment(USh.m, s = s)[, 2] EPC[, 6] <- fChernoff(USh.m, s = s)[, 2] matplot(s, EPC, type = "l", lwd = 2, xlab = "s", ylim = c(0, 1), lty = 1:6, ylab = expression(plain(Pr)(S>=s)), main = "Exceedance Probability Curve") zoombox(s, EPC, x0 = c(30, 40), y0 = c(0, .1), y1 = c(.3, .6), type = "l", lwd = 2, lty = 1:6) legend("topright", legend = colnames(EPC), lty = 1:6, col = 1:6, lwd = 2)
data(UShurricane) # Compress the table to millions of dollars USh.m <- compressELT(ELT(UShurricane), digits = -6) s <- seq(1,40) EPC <- matrix(NA, length(s), 6) colnames(EPC) <- c("Panjer", "MonteCarlo", "Markov", "Cantelli", "Moment", "Chernoff") EPC[, 1] <- fPanjer(USh.m, s = s)[, 2] EPC[, 2] <- fMonteCarlo(USh.m, s = s)[, 2] EPC[, 3] <- fMarkov(USh.m, s = s)[, 2] EPC[, 4] <- fCantelli(USh.m, s = s)[, 2] EPC[, 5] <- fMoment(USh.m, s = s)[, 2] EPC[, 6] <- fChernoff(USh.m, s = s)[, 2] matplot(s, EPC, type = "l", lwd = 2, xlab = "s", ylim = c(0, 1), lty = 1:6, ylab = expression(plain(Pr)(S>=s)), main = "Exceedance Probability Curve") zoombox(s, EPC, x0 = c(30, 40), y0 = c(0, .1), y1 = c(.3, .6), type = "l", lwd = 2, lty = 1:6) legend("topright", legend = colnames(EPC), lty = 1:6, col = 1:6, lwd = 2)