simulate_path,SparreAndersenCapitalInjections-method {ruin}R Documentation

Simulates a path of a Sparre Andersen model's extension with capital injections

Description

simulate_path() simulates a path of SparreAndersenCapitalInjections model until one of the following conditions is met: (1) the process is ruined, (2) max_time_horizon is achieved, (3) the elapsed time of the simulation is greater than max_simulation_time.

Usage

## S4 method for signature 'SparreAndersenCapitalInjections'
simulate_path(model,
  max_time_horizon = NULL, max_simulation_time = NULL, seed = NULL)

Arguments

model

an S4 object of SparreAndersenCapitalInjections class.

max_time_horizon

a length one numeric vector specifying the maximum time horizon, until with the process will be simulated. Default: Inf.

max_simulation_time

a length one numeric vector indicating the maximum allowed time of simulation. The value should be specified in seconds. Default: Inf.

seed

an optional arbitrary length numeric vector specifying the seed. If provided, the .Random.seed in .GlobalEnv is set to its value.

Value

PathSparreAndersenCapitalInjections

Warning

Setting both max_time_horizon and max_simulation_time to Inf might be dangerous. In this case, the only stopping condition is a ruin of the process, which might not happen.

Examples

model <- SparreAndersenCapitalInjections(
  initial_capital = 10,
  premium_rate = 1,
  claim_interarrival_generator = rexp,
  claim_interarrival_parameters = list(rate = 1),
  claim_size_generator = rexp,
  claim_size_parameters = list(rate = 1),
  capital_injection_interarrival_generator = rexp,
  capital_injection_interarrival_parameters = list(rate = 1),
  capital_injection_size_generator = rexp,
  capital_injection_size_parameters = list(rate = 2)
)

path <- simulate_path(model = model, max_time_horizon = 10)

[Package ruin version 0.1.1 Index]