Learn R Programming

lifepack (version 0.1.0)

reserve: Reserve This function calculates the reserve given the reward matrix and some constant rate This function requires proper construction of reward matrix as specified in the lecture notes provided in the course Liv1 at the University of Copenhagen.

Description

Reserve This function calculates the reserve given the reward matrix and some constant rate This function requires proper construction of reward matrix as specified in the lecture notes provided in the course Liv1 at the University of Copenhagen.

Usage

reserve(t, TT, Lambda, R, mu, r, n)

Value

Returns a matrix of statewise reserves

Arguments

t

initial timepoint

TT

end timepoint

Lambda

intensity matrix

R

reward matrix

mu

equivalence premium

r

constant rate as a scalar

n

number of steps for the Runge-Kutta algorithm

Examples

Run this code
Lambda <- function(x) matrix(c(-0.1, 0.1, 0, -0.1), 2, 2)
R <- function(x, mu) matrix(c(0, 0, 0, mu), 2, 2)
reserve(0, 80, Lambda, R, 200000, 0.01, 1000)

Run the code above in your browser using DataLab