Ruin within a finite horizon
finite_horizon_ruin.RdThe probability psi(u, t) that the surplus, starting at u, earning
premium a period and paying each period's aggregate loss at its end,
is negative at the end of some period up to t. It is found by the
recursion psi_t(u) = P(S > u + c) + E[psi_{t-1}(u + c - S); S <= u + c]
on the severity's grid, the convolution by FFT, so it holds for any
claim count a period. eventual_ruin() is the limit for Poisson claims
checked continuously; give a Poisson rate with sub_periods to check
sub_periods times a period instead (each step Poisson with
rate / sub_periods), which approaches it from below as the steps
shrink.
Usage
finite_horizon_ruin(
severity,
premium,
periods,
frequency = NULL,
rate = NULL,
sub_periods = 1,
points = NULL,
p = numeric()
)Arguments
- severity
The premium a period.
- periods
The horizon in periods.
- frequency
The claim count a period. Or give
rate.- rate
A Poisson rate a period.
- sub_periods
Steps a period, with
rate.- points
Grid points for
psi; the severity's by default. Beyond the gridpsiis cut off, so raise it untilpsiat the last point is small.- p
Ruin probabilities at which to find the capital.
Value
A list: u, the grid; psi, a matrix with one row per u and
one column per period; capital and capital_interpolated, matrices
with one row per p and one column per period (the smallest grid
point with psi(u, t) < p, or linear between grid points; NA where
the grid does not reach it); step and aliasing_error.
Examples
# A claim of 2 with probability 0.4 a period, premium 1: a random walk.
walk <- finite_horizon_ruin(grid_distribution(1, c(0, 0, 1)), 1, 3,
frequency = bernoulli_count(0.4), points = 16)
walk$psi[1, ] # 0.4, 0.4 + 0.6 * 0.4^2 by the third period
#> [1] 0.400 0.400 0.496
sev <- discretize(gamma_from_mean_cv(1, 1), step = 0.05, points = 2^12, method = "rounding")
ruin <- finite_horizon_ruin(sev, 1.5, 10, rate = 1, sub_periods = 10, p = 0.05)
ruin$capital
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#> [1,] 2.95 3.9 4.5 4.95 5.3 5.55 5.8 6 6.2 6.35