ruin_probability {ruin}R Documentation

Estimate a ruin probability for a finite time horizon

Description

ruin_probability simulates paths for a given risk model and returns a crude Monte-Carlo estimate of the ruin probability for the finite time horizon.

Usage

ruin_probability(model, time_horizon, simulation_number = NULL,
  ci_level = NULL, parallel = NULL, return_paths = NULL)

Arguments

model

an S4 object indicating a risk model (e.g., CramerLundberg).

time_horizon

a length one numeric finite vector specifying the time at which the ruin probability should be estimated.

simulation_number

a length one numeric vector giving the number of simulations that should be performed. Default: 10000.

ci_level

a length one numeric vector between 0 and 1 indicating the level of the confidence interval of the ruin probability. Default: 0.95.

parallel

a length one logical vector indicating whether the parallel computing should be used. Default: TRUE.

return_paths

a length one logical vector indicating whether a list of simulated paths should be returned. Default: FALSE.

Details

The function uses a parallel computing from the package parallel (if parallel is TRUE). The package sets up RNGkind to "L'Ecuyer-CMRG" for a safe seeding (see nextRNGStream) when it is loaded, so that user does not have to take care of seeds / RNGs. Further, the function allows computing the confidence interval, assuming the normal distribution of the ruin probability (thanks to CLT).

Value

A list of two elements: a numeric vector of lower bound of CI, estimate, and upper bound of CI of the ruin probability; and optionally the list of simulated paths.

Examples

model <- CramerLundberg(initial_capital = 0,
                        premium_rate = 1,
                        claim_poisson_arrival_rate = 1,
                        claim_size_generator = rexp,
                        claim_size_parameters = list(rate = 1))
ruin_probability(model = model,
                 time_horizon = 10,
                 simulation_number = 100,
                 return_paths = TRUE,
                 parallel = FALSE)


[Package ruin version 0.1.1 Index]