Title: | Simulation of Various Risk Processes |
---|---|
Description: | A (not yet exhaustive) collection of common models of risk processes in actuarial science, represented as formal S4 classes. Each class (risk model) has a simulator of its path, and a plotting function. Further, a Monte-Carlo estimator of a ruin probability for a finite time is implemented, using a parallel computation. Currently, the package extends two classical risk models Cramer-Lundberg and Sparre Andersen models by including capital injections, that are positive jumps (see Breuer L. and Badescu A.L. (2014) <doi:10.1080/03461238.2011.636969>). The intent of the package is to provide a user-friendly interface for ruin processes' simulators, as well as a solid and extensible structure for future extensions. |
Authors: | Iegor Rudnytskyi [aut, cre] |
Maintainer: | Iegor Rudnytskyi <[email protected]> |
License: | GPL-3 |
Version: | 0.1.1 |
Built: | 2024-11-13 05:44:51 UTC |
Source: | https://github.com/irudnyts/ruin |
CramerLundberg()
constructs an object of CramerLundberg
S4
class.
CramerLundberg(initial_capital = NULL, premium_rate = NULL, claim_poisson_arrival_rate = NULL, claim_size_generator = NULL, claim_size_parameters = NULL)
CramerLundberg(initial_capital = NULL, premium_rate = NULL, claim_poisson_arrival_rate = NULL, claim_size_generator = NULL, claim_size_parameters = NULL)
initial_capital |
a length one numeric non-negative vector specifying an
initial capital. Default: |
premium_rate |
a length one numeric non-negative vector specifying a
premium rate. Default: |
claim_poisson_arrival_rate |
a length one numeric positive vector
specifying the rate of the Poisson process of claims' arrivals. Default:
|
claim_size_generator |
a function indicating the random generator of
claims' sizes. Default: |
claim_size_parameters |
a named list containing parameters for the
random generator of claims' sizes. Default: |
The function constructs an object of a formal S4 class CramerLundberg
,
a representation of classical risk process defined as follows:
where is the initial capital (
initial_capital
), is the
premium rate (
premium_rate
), is the Poisson process with
intensity
(
claim_poisson_arrival_rate
), are
iid claim sizes (
claim_size_generator
and claim_size_parameters
).
An object of CramerLundberg class.
Albrecher H., Asmussen A. Ruin Probabilities. World Scientific, 2010.
CramerLundbergCapitalInjections
,
SparreAndersen
, link{SparreAndersenCapitalInjections}
.
model <- CramerLundberg(initial_capital = 10, premium_rate = 1, claim_poisson_arrival_rate = 1, claim_size_generator = rexp, claim_size_parameters = list(rate = 1))
model <- CramerLundberg(initial_capital = 10, premium_rate = 1, claim_poisson_arrival_rate = 1, claim_size_generator = rexp, claim_size_parameters = list(rate = 1))
A formal S4 class representation of classical Cramer-Lundberg model.
The model is defined as follows:
where is the initial capital (
initial_capital
), is the
premium rate (
premium_rate
), is the Poisson process with
intensity
(
claim_poisson_arrival_rate
), are
iid claim sizes (
claim_size_generator
and claim_size_parameters
).
Objects of class can be created only by using the constructor
CramerLundberg
.
initial_capital
a length one numeric non-negative vector specifying an initial capital.
premium_rate
a length one numeric non-negative vector specifying a premium rate.
claim_poisson_arrival_rate
a length one numeric positive vector specifying the rate of the Poisson process of claims' arrivals.
claim_size_generator
a function indicating the random generator of claims' sizes.
claim_size_parameters
a named list containing parameters for the random generator of claims' sizes.
Albrecher H., Asmussen A. Ruin Probabilities. World Scientific, 2010.
CramerLundbergCapitalInjections()
constructs an object of
CramerLundbergCapitalInjections
S4 class.
CramerLundbergCapitalInjections(initial_capital = NULL, premium_rate = NULL, claim_poisson_arrival_rate = NULL, claim_size_generator = NULL, claim_size_parameters = NULL, capital_injection_poisson_rate = NULL, capital_injection_size_generator = NULL, capital_injection_size_parameters = NULL)
CramerLundbergCapitalInjections(initial_capital = NULL, premium_rate = NULL, claim_poisson_arrival_rate = NULL, claim_size_generator = NULL, claim_size_parameters = NULL, capital_injection_poisson_rate = NULL, capital_injection_size_generator = NULL, capital_injection_size_parameters = NULL)
initial_capital |
a length one numeric non-negative vector specifying an
initial capital. Default: |
premium_rate |
a length one numeric non-negative vector specifying a
premium rate. Default: |
claim_poisson_arrival_rate |
a length one numeric positive vector
specifying the rate of the Poisson process of claims' arrivals. Default:
|
claim_size_generator |
a function indicating the random generator of
claims' sizes. Default: |
claim_size_parameters |
a named list containing parameters for the
random generator of claims' sizes. Default: |
capital_injection_poisson_rate |
a length one numeric positive vector
specifying the rate of the Poisson process of capital injections' arrivals.
Default: |
capital_injection_size_generator |
a function indicating the random
generator of capital injections' sizes. Default: |
capital_injection_size_parameters |
a named list containing parameters
for the random generator of capital injections' sizes. Default:
|
The function constructs an object of a formal S4 class
CramerLundbergCapitalInjections
, a representation of an extension of
Cramer-Lundberg model that allows for positive jumps and defined as follows:
where is the initial capital (
initial_capital
), is the
premium rate (
premium_rate
), is the Poisson process
of positive jumps (capital injections) with intensity
(
capital_injection_poisson_rate
), are
iid capital injections' sizes (
capital_injection_size_generator
and capital_injection_size_parameters
), is the
Poisson process of negative jumps (claims) with intensity
(
claim_poisson_arrival_rate
), are iid claim sizes
(
claim_size_generator
and claim_size_parameters
).
An object of CramerLundbergCapitalInjections class.
Breuera L., Badescu A. L. A generalised Gerber Shiu measure for Markov-additive risk processes with phase-type claims and capital injections. Scandinavian Actuarial Journal, 2014(2): 93-115, 2014.
CramerLundberg
,
SparreAndersen
, link{SparreAndersenCapitalInjections}
.
model <- CramerLundbergCapitalInjections( initial_capital = 10, premium_rate = 1, claim_poisson_arrival_rate = 1, claim_size_generator = rexp, claim_size_parameters = list(rate = 1), capital_injection_poisson_rate = 1, capital_injection_size_generator = rexp, capital_injection_size_parameters = list(rate = 1) )
model <- CramerLundbergCapitalInjections( initial_capital = 10, premium_rate = 1, claim_poisson_arrival_rate = 1, claim_size_generator = rexp, claim_size_parameters = list(rate = 1), capital_injection_poisson_rate = 1, capital_injection_size_generator = rexp, capital_injection_size_parameters = list(rate = 1) )
A formal S4 class representation of Cramer-Lundberg's extension that includes capital injections.
The model is defined as follows:
where is the initial capital (
initial_capital
), is the
premium rate (
premium_rate
), is the Poisson process
of positive jumps (capital injections) with intensity
(
capital_injection_poisson_rate
), are
iid capital injections' sizes (
capital_injection_size_generator
and capital_injection_size_parameters
), is the
Poisson process of negative jumps (claims) with intensity
(
claim_poisson_arrival_rate
), are iid claim sizes
(
claim_size_generator
and claim_size_parameters
).
Objects of class can be created only by using the constructor
CramerLundbergCapitalInjections
.
initial_capital
a length one numeric non-negative vector specifying an initial capital.
premium_rate
a length one numeric non-negative vector specifying a premium rate.
claim_poisson_arrival_rate
a length one numeric positive vector specifying the rate of the Poisson process of claims' arrivals.
claim_size_generator
a function indicating the random generator of claims' sizes.
claim_size_parameters
a named list containing parameters for the random generator of claims' sizes.
capital_injection_poisson_rate
a length one numeric positive vector specifying the rate of the Poisson process of capital injections' arrivals.
capital_injection_size_generator
a function indicating the random generator of capital injections' sizes.
capital_injection_size_parameters
a named list containing parameters for the random generator of capital injections' sizes.
Breuera L., Badescu A. L. A generalised Gerber Shiu measure for Markov-additive risk processes with phase-type claims and capital injections. Scandinavian Actuarial Journal, 2014(2): 93-115, 2014.
CramerLundbergCapitalInjections
A formal S4 class to contain a simulated path of CramerLundberg model.
Objects of the class must not be created manually. Instead, objects of this
class are returned by simulate_path
.
model
an object of CramerLundberg class.
path
a numeric matrix of columns "time"
and "X"
defining
the simulated path represented by pairs time-value.
claim_sizes
a numeric vector of claims' sizes.
claim_arrival_times
a numeric vector of claims' interarrival times.
time_horizon
a numeric vector of the maximum time horizon achieved.
is_ruined
a logical vector indicating whether the process is ruined.
elapsed_time
a numeric vector of the elapsed simulation time in seconds.
max_time_horizon
a numeric vector of the maximum time horizon allowed.
max_simulation_time
a numeric vector of the maximum simulation time in seconds.
seed
a numeric vector indicating the seed used for simulation.
CramerLundberg (class definition),
CramerLundberg
(constructor).
A formal S4 class to contain a simulated path of CramerLundbergCapitalInjections model.
Objects of the class must not be created manually. Instead, objects of this
class are returned by simulate_path
.
model
an object of CramerLundbergCapitalInjections class.
path
a numeric matrix of columns "time"
and "X"
defining
the simulated path represented by pairs time-value.
claim_sizes
a numeric vector of claims' sizes.
claim_arrival_times
a numeric vector of claims' interarrival times.
capital_injection_sizes
a numeric vector of capital injections' sizes.
capital_injection_arrival_times
a numeric vector of capital injections' interarrival times.
time_horizon
a numeric vector of the maximum time horizon achieved.
is_ruined
a logical vector indicating whether the process is ruined.
elapsed_time
a numeric vector of the elapsed simulation time in seconds.
max_time_horizon
a numeric vector of the maximum time horizon allowed.
max_simulation_time
a numeric vector of the maximum simulation time in seconds.
seed
a numeric vector indicating the seed used for simulation.
CramerLundbergCapitalInjections (class definition),
CramerLundbergCapitalInjections
(constructor).
A formal S4 class to contain a simulated path of SparreAndersen model.
Objects of the class must not be created manually. Instead, objects of this
class are returned by simulate_path
.
model
an object of CramerLundberg class.
path
a numeric matrix of columns "time"
and "X"
defining
the simulated path represented by pairs time-value.
claim_sizes
a numeric vector of claims' sizes.
claim_arrival_times
a numeric vector of claims' interarrival times.
time_horizon
a numeric vector of the maximum time horizon achieved.
is_ruined
a logical vector indicating whether the process is ruined.
elapsed_time
a numeric vector of the elapsed simulation time in seconds.
max_time_horizon
a numeric vector of the maximum time horizon allowed.
max_simulation_time
a numeric vector of the maximum simulation time in seconds.
seed
a numeric vector indicating the seed used for simulation.
SparreAndersen (class definition),
SparreAndersen
(constructor).
A formal S4 class to contain a simulated path of SparreAndersenCapitalInjections model.
Objects of the class must not be created manually. Instead, objects of this
class are returned by simulate_path
.
model
an object of SparreAndersenCapitalInjections class.
path
a numeric matrix of columns "time"
and "X"
defining
the simulated path represented by pairs time-value.
claim_sizes
a numeric vector of claims' sizes.
claim_arrival_times
a numeric vector of claims' interarrival times.
capital_injection_sizes
a numeric vector of capital injections' sizes.
capital_injection_arrival_times
a numeric vector of capital injections' interarrival times.
time_horizon
a numeric vector of the maximum time horizon achieved.
is_ruined
a logical vector indicating whether the process is ruined.
elapsed_time
a numeric vector of the elapsed simulation time in seconds.
max_time_horizon
a numeric vector of the maximum time horizon allowed.
max_simulation_time
a numeric vector of the maximum simulation time in seconds.
seed
a numeric vector indicating the seed used for simulation.
SparreAndersenCapitalInjections (class definition),
SparreAndersenCapitalInjections
(constructor).
plot_path()
takes a simulated ruin process as the argument and plots
its path.
plot_path(path_object)
plot_path(path_object)
path_object |
an S4 object of *Path class (e.g., PathCramerLundberg). |
Under the hood, the function uses ggplot2
package, therefore,
all functionality from ggplot2
is available.
A ggplot2
object.
model <- CramerLundberg(initial_capital = 10, premium_rate = 1, claim_poisson_arrival_rate = 1, claim_size_generator = rexp, claim_size_parameters = list(rate = 1)) path <- simulate_path(model = model, max_time_horizon = 10) plot_path(path)
model <- CramerLundberg(initial_capital = 10, premium_rate = 1, claim_poisson_arrival_rate = 1, claim_size_generator = rexp, claim_size_parameters = list(rate = 1)) path <- simulate_path(model = model, max_time_horizon = 10) plot_path(path)
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.
ruin_probability(model, time_horizon, simulation_number = NULL, ci_level = NULL, parallel = NULL, return_paths = NULL)
ruin_probability(model, time_horizon, simulation_number = NULL, ci_level = NULL, parallel = NULL, return_paths = NULL)
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: |
ci_level |
a length one numeric vector between 0 and 1 indicating the
level of the confidence interval of the ruin probability. Default:
|
parallel |
a length one logical vector indicating whether the parallel
computing should be used. Default: |
return_paths |
a length one logical vector indicating whether a list of
simulated paths should be returned. Default: |
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).
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.
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)
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)
simulate_path()
simulates a path of a given risk 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
.
simulate_path(model, max_time_horizon = NULL, max_simulation_time = NULL, seed = NULL)
simulate_path(model, max_time_horizon = NULL, max_simulation_time = NULL, seed = NULL)
model |
an S4 object indicating a risk model (e.g., CramerLundberg). |
max_time_horizon |
a length one numeric vector specifying the maximum
time horizon, until with the process will be simulated. Default: |
max_simulation_time |
a length one numeric vector indicating the maximum
allowed time of simulation. The value should be specified in seconds.
Default: |
seed |
an optional arbitrary length numeric vector specifying the seed.
If provided, the |
An S4 corresponding to model
class object. For instance, for
CramerLundberg, the object of class
PathCramerLundberg is returned.
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.
model <- CramerLundberg(initial_capital = 10, premium_rate = 1, claim_poisson_arrival_rate = 1, claim_size_generator = rexp, claim_size_parameters = list(rate = 1)) path <- simulate_path(model = model, max_time_horizon = 10)
model <- CramerLundberg(initial_capital = 10, premium_rate = 1, claim_poisson_arrival_rate = 1, claim_size_generator = rexp, claim_size_parameters = list(rate = 1)) path <- simulate_path(model = model, max_time_horizon = 10)
simulate_path()
simulates a path of CramerLundberg
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
.
## S4 method for signature 'CramerLundberg' simulate_path(model, max_time_horizon = NULL, max_simulation_time = NULL, seed = NULL)
## S4 method for signature 'CramerLundberg' simulate_path(model, max_time_horizon = NULL, max_simulation_time = NULL, seed = NULL)
model |
an S4 object of CramerLundberg class. |
max_time_horizon |
a length one numeric vector specifying the maximum
time horizon, until with the process will be simulated. Default: |
max_simulation_time |
a length one numeric vector indicating the maximum
allowed time of simulation. The value should be specified in seconds.
Default: |
seed |
an optional arbitrary length numeric vector specifying the seed.
If provided, the |
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.
model <- CramerLundberg(initial_capital = 10, premium_rate = 1, claim_poisson_arrival_rate = 1, claim_size_generator = rexp, claim_size_parameters = list(rate = 1)) path <- simulate_path(model = model, max_time_horizon = 10)
model <- CramerLundberg(initial_capital = 10, premium_rate = 1, claim_poisson_arrival_rate = 1, claim_size_generator = rexp, claim_size_parameters = list(rate = 1)) path <- simulate_path(model = model, max_time_horizon = 10)
simulate_path()
simulates a path of
CramerLundbergCapitalInjections 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
.
## S4 method for signature 'CramerLundbergCapitalInjections' simulate_path(model, max_time_horizon = NULL, max_simulation_time = NULL, seed = NULL)
## S4 method for signature 'CramerLundbergCapitalInjections' simulate_path(model, max_time_horizon = NULL, max_simulation_time = NULL, seed = NULL)
model |
an S4 object of CramerLundbergCapitalInjections class. |
max_time_horizon |
a length one numeric vector specifying the maximum
time horizon, until with the process will be simulated. Default: |
max_simulation_time |
a length one numeric vector indicating the maximum
allowed time of simulation. The value should be specified in seconds.
Default: |
seed |
an optional arbitrary length numeric vector specifying the seed.
If provided, the |
PathCramerLundbergCapitalInjections
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.
model <- CramerLundbergCapitalInjections( initial_capital = 10, premium_rate = 1, claim_poisson_arrival_rate = 1, claim_size_generator = rexp, claim_size_parameters = list(rate = 1), capital_injection_poisson_rate = 1, capital_injection_size_generator = rexp, capital_injection_size_parameters = list(rate = 2) ) path <- simulate_path(model = model, max_time_horizon = 10)
model <- CramerLundbergCapitalInjections( initial_capital = 10, premium_rate = 1, claim_poisson_arrival_rate = 1, claim_size_generator = rexp, claim_size_parameters = list(rate = 1), capital_injection_poisson_rate = 1, capital_injection_size_generator = rexp, capital_injection_size_parameters = list(rate = 2) ) path <- simulate_path(model = model, max_time_horizon = 10)
simulate_path()
simulates a path of SparreAndersen
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
.
## S4 method for signature 'SparreAndersen' simulate_path(model, max_time_horizon = NULL, max_simulation_time = NULL, seed = NULL)
## S4 method for signature 'SparreAndersen' simulate_path(model, max_time_horizon = NULL, max_simulation_time = NULL, seed = NULL)
model |
an S4 object of SparreAndersen class. |
max_time_horizon |
a length one numeric vector specifying the maximum
time horizon, until with the process will be simulated. Default: |
max_simulation_time |
a length one numeric vector indicating the maximum
allowed time of simulation. The value should be specified in seconds.
Default: |
seed |
an optional arbitrary length numeric vector specifying the seed.
If provided, the |
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.
model <- SparreAndersen(initial_capital = 10, premium_rate = 1, claim_interarrival_generator = rexp, claim_interarrival_parameters = list(rate = 2), claim_size_generator = rexp, claim_size_parameters = list(rate = 1)) path <- simulate_path(model = model, max_time_horizon = 10)
model <- SparreAndersen(initial_capital = 10, premium_rate = 1, claim_interarrival_generator = rexp, claim_interarrival_parameters = list(rate = 2), claim_size_generator = rexp, claim_size_parameters = list(rate = 1)) path <- simulate_path(model = model, max_time_horizon = 10)
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
.
## S4 method for signature 'SparreAndersenCapitalInjections' simulate_path(model, max_time_horizon = NULL, max_simulation_time = NULL, seed = NULL)
## S4 method for signature 'SparreAndersenCapitalInjections' simulate_path(model, max_time_horizon = NULL, max_simulation_time = NULL, seed = NULL)
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: |
max_simulation_time |
a length one numeric vector indicating the maximum
allowed time of simulation. The value should be specified in seconds.
Default: |
seed |
an optional arbitrary length numeric vector specifying the seed.
If provided, the |
PathSparreAndersenCapitalInjections
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.
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)
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)
SparreAndersen()
constructs an object of SparreAndersen
S4
class.
SparreAndersen(initial_capital = NULL, premium_rate = NULL, claim_interarrival_generator = NULL, claim_interarrival_parameters = NULL, claim_size_generator = NULL, claim_size_parameters = NULL)
SparreAndersen(initial_capital = NULL, premium_rate = NULL, claim_interarrival_generator = NULL, claim_interarrival_parameters = NULL, claim_size_generator = NULL, claim_size_parameters = NULL)
initial_capital |
a length one numeric non-negative vector specifying an
initial capital. Default: |
premium_rate |
a length one numeric non-negative vector specifying a
premium rate. Default: |
claim_interarrival_generator |
a function indicating the random
generator of claims' interarrival times. Default: |
claim_interarrival_parameters |
a named list containing parameters for
the random generator of claims' interarrival times. Default:
|
claim_size_generator |
a function indicating the random generator of
claims' sizes. Default: |
claim_size_parameters |
a named list containing parameters for the
random generator of claims' sizes. Default: |
The function constructs an object of a formal S4 class
SparreAndersen
, a representation of an extension of
Cramer-Lundberg model that allows for non-exponential interarrival times and
defined as follows:
where is the initial capital (
initial_capital
), is the
premium rate (
premium_rate
), is the renewal process defined
by distribution of interarrival times (
claim_interarrival_generator
and claim_interarrival_parameters
), are iid claim sizes
(
claim_size_generator
and claim_size_parameters
).
An object of SparreAndersen class.
Andersen, E. Sparre. On the collective theory of risk in case of contagion between claims. Transactions of the XVth International Congress of Actuaries, 2(6), 1957.
Thorin O. Some Comments on the Sparre Andersen Model in the Risk Theory. ASTIN Bulletin: The Journal of the IAA, 8(1):104-125, 1974.
CramerLundberg
,
CramerLundbergCapitalInjections
,
link{SparreAndersenCapitalInjections}
.
model <- SparreAndersen( 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) )
model <- SparreAndersen( 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) )
A formal S4 class representation of classical Sparre Andersen model.
The model is defined as follows:
where is the initial capital (
initial_capital
), is the
premium rate (
premium_rate
), is the renewal process defined
by distribution of interarrival times (
claim_interarrival_generator
and claim_interarrival_parameters
), are iid claim sizes
(
claim_size_generator
and claim_size_parameters
).
Objects of class can be created only by using the constructor
SparreAndersen
.
initial_capital
a length one numeric non-negative vector specifying an initial capital.
premium_rate
a length one numeric non-negative vector specifying a premium rate.
claim_interarrival_generator
a function indicating the random generator of claims' interarrival times.
claim_interarrival_parameters
a named list containing parameters for the random generator of claims' interarrival times.
claim_size_generator
a function indicating the random generator of claims' sizes.
claim_size_parameters
a named list containing parameters for the random generator of claims' sizes.
Andersen, E. Sparre. On the collective theory of risk in case of contagion between claims. Transactions of the XVth International Congress of Actuaries, 2(6), 1957.
Thorin O. Some Comments on the Sparre Andersen Model in the Risk Theory. ASTIN Bulletin: The Journal of the IAA, 8(1):104-125, 1974.
SparreAndersenCapitalInjections()
constructs an object of
SparreAndersenCapitalInjections
S4 class.
SparreAndersenCapitalInjections(initial_capital = NULL, premium_rate = NULL, claim_interarrival_generator = NULL, claim_interarrival_parameters = NULL, claim_size_generator = NULL, claim_size_parameters = NULL, capital_injection_interarrival_generator = NULL, capital_injection_interarrival_parameters = NULL, capital_injection_size_generator = NULL, capital_injection_size_parameters = NULL)
SparreAndersenCapitalInjections(initial_capital = NULL, premium_rate = NULL, claim_interarrival_generator = NULL, claim_interarrival_parameters = NULL, claim_size_generator = NULL, claim_size_parameters = NULL, capital_injection_interarrival_generator = NULL, capital_injection_interarrival_parameters = NULL, capital_injection_size_generator = NULL, capital_injection_size_parameters = NULL)
initial_capital |
a length one numeric non-negative vector specifying an
initial capital. Default: |
premium_rate |
a length one numeric non-negative vector specifying a
premium rate. Default: |
claim_interarrival_generator |
a function indicating the random
generator of claims' interarrival times. Default: |
claim_interarrival_parameters |
a named list containing parameters for
the random generator of claims' interarrival times. Default:
|
claim_size_generator |
a function indicating the random generator of
claims' sizes. Default: |
claim_size_parameters |
a named list containing parameters for the
random generator of claims' sizes. Default: |
capital_injection_interarrival_generator |
a function indicating
the random generator of capital injections' interarrival times. Default:
|
capital_injection_interarrival_parameters |
a named list containing
parameters for the random generator of capital injections' interarrival
times. Default: |
capital_injection_size_generator |
a function indicating the random
generator of capital injections' sizes. Default: |
capital_injection_size_parameters |
a named list containing parameters
for the random generator of capital injections' sizes. Default:
|
The function constructs an object of a formal S4 class
SparreAndersenCapitalInjections
, a representation of an extension of
Sparre Andersen model that allows for positive jumps and defined as follows:
where is the initial capital (
initial_capital
), is the
premium rate (
premium_rate
), is the renewal process
of positive jumps (capital injections) defined by distribution of
interarrival times (
capital_injection_interarrival_generator
and
capital_injection_interarrival_parameters
), are iid
capital injections' sizes (
capital_injection_size_generator
and capital_injection_size_parameters
), is the
renewal process of claims defined by distribution of interarrival times
(
claim_interarrival_generator
and
claim_interarrival_parameters
), are iid claim sizes
(
claim_size_generator
and claim_size_parameters
).
An object of SparreAndersenCapitalInjections class.
Breuera L., Badescu A. L. A generalised Gerber Shiu measure for Markov-additive risk processes with phase-type claims and capital injections. Scandinavian Actuarial Journal, 2014(2): 93-115, 2014.
CramerLundberg
,
CramerLundbergCapitalInjections
,
link{SparreAndersen}
.
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 = 1) )
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 = 1) )
A formal S4 class representation of Sparre Andersen's extension that includes capital injections.
The model is defined as follows:
where is the initial capital (
initial_capital
), is the
premium rate (
premium_rate
), is the renewal process
of positive jumps (capital injections) defined by distribution of
interarrival times (
capital_injection_interarrival_generator
and
capital_injection_interarrival_parameters
), are iid
capital injections' sizes (
capital_injection_size_generator
and capital_injection_size_parameters
), is the
renewal process of claims defined by distribution of interarrival times
(
claim_interarrival_generator
and
claim_interarrival_parameters
), are iid claim sizes
(
claim_size_generator
and claim_size_parameters
).
Objects of class can be created only by using the constructor
SparreAndersenCapitalInjections
.
initial_capital
a length one numeric non-negative vector specifying an initial capital.
premium_rate
a length one numeric non-negative vector specifying a premium rate.
claim_interarrival_generator
a function indicating the random generator of claims' interarrival times.
claim_interarrival_parameters
a named list containing parameters for the random generator of claims' interarrival times.
claim_size_generator
a function indicating the random generator of claims' sizes.
claim_size_parameters
a named list containing parameters for the random generator of claims' sizes.
capital_injection_interarrival_generator
a function indicating the random generator of capital injections' interarrival times.
capital_injection_interarrival_parameters
a named list containing parameters for the random generator of capital injections' interarrival times.
capital_injection_size_generator
a function indicating the random generator of capital injections' sizes.
capital_injection_size_parameters
a named list containing parameters for the random generator of capital injections' sizes.
Breuera L., Badescu A. L. A generalised Gerber Shiu measure for Markov-additive risk processes with phase-type claims and capital injections. Scandinavian Actuarial Journal, 2014(2): 93-115, 2014.
SparreAndersenCapitalInjections