Package 'lifepack'

Title: Insurance Reserve Calculations
Description: Calculates insurance reserves and equivalence premiums using advanced numerical methods, including the Runge-Kutta algorithm and product integrals for transition probabilities. This package is useful for actuarial analyses and life insurance modeling, facilitating accurate financial projections.
Authors: Oskar Allerslev [aut, cre]
Maintainer: Oskar Allerslev <[email protected]>
License: GPL-3
Version: 0.0.8
Built: 2025-01-30 05:24:35 UTC
Source: https://github.com/oskarallerslev/lifepack

Help Index


Equivalence Premium

Description

This function calculates the equivalence premium for an insurance contract.

Usage

equiv_premium(s, t, Lambda, R, dR, mu, r, n)

Arguments

s

Initial timepoint

t

End timepoint

Lambda

Intensity matrix

R

Reward matrix

dR

Differential of reward matrix

mu

Equivalence premium guess

r

Constant rate as a scalar

n

Number of steps for the Runge-Kutta algorithm

Value

A scalar

Examples

Lambda <- function(x) matrix(c(-0.1, 0.1, 0.05, -0.05), nrow = 2)
R <- function(x, mu) matrix(c(mu, 0, 0, mu), nrow = 2) # Corrected
dR <- function(x, mu) matrix(c(0.1, 0, 0, 0.1), nrow = 2)
equiv_premium(0, 80, Lambda, R, dR, 0.05, 0.03, 100)

Productintegral This function calculates the productintegral of a matrix from s to t with a given number of steps for the runge kutta

Description

Productintegral This function calculates the productintegral of a matrix from s to t with a given number of steps for the runge kutta

Usage

prodint(A, s, t, n)

Arguments

A

intensity matrix

s

initial timepoint

t

end timepoint

n

number of steps for the runge kutta algorithm

Value

returns a matrix (if using an intensity matrix as A you are given the transition probabilities)

Examples

Lambda <- function(x) matrix(c(-0.1, 0.1, 0, -0.1), 2, 2)
prodint(Lambda, 0, 80, 100)

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)

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

Value

Returns a matrix of statewise reserves

Examples

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)

Reserve with Dynamic Rate

Description

This function calculates the reserve matrix using a dynamic interest rate function. It extends the functionality of the reserve function by allowing the rate to vary over time.

Usage

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

Arguments

t

Initial timepoint

TT

End timepoint

Lambda

Intensity matrix

R

Reward matrix

mu

Equivalence premium

r

A function of time that returns the interest rate

n

Number of steps for the Runge-Kutta algorithm

Value

A matrix representing statewise reserves

Examples

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)
rentefun <- function(x) { 0.01 + 0.001 * x }  # Dynamic interest rate
sreserve(0, 80, Lambda, R, 200000, rentefun, 1000)