Learn R Programming

Valuer - VA value with R

Valuer aims at pricing a type of life insurance contract called variable annuity. The package implements the valuation framework and algorithms described in BMOP2011 where Monte Carlo methods are adapted to the life insurance case. It's written using R6 and comes with classes which describe the variable annuity contracts and other classes, called pricing engines, which are used to price those contracts.

Example

The following code prices a 10 years VA with GMAB guarantee by means of a pricing engine which models the underlying fund as a geometric Brownian motion. Please check the introductory vignette for an explanation of this example and a description of the package structure.

library(valuer)
#> Loading required package: orthopolynom
#> Loading required package: polynom

rate <- constant_parameters$new(0.01)

premium <- 100
rollup <- payoff_rollup$new(premium, rate)

#Ten years time-line
begin <- timeDate::timeDate("2016-01-01")
end <- timeDate::timeDate("2025-12-31")

#Age of the policyholder.
age <- 60
# A constant fee of 4% per year (365 days)
fee <- constant_parameters$new(0.04)

#Barrier for a state-dependent fee. The fee will be applied only if
#the value of the account is below the barrier
barrier <- Inf
#Withdrawal penalty applied in case the insured surrenders the contract
#It is a constant penalty in this case
penalty <- penalty_class$new(type = 1, 0.01)
#Sets up the contract with GMAB guarantee
contract <- GMAB$new(rollup, t0 = begin, t = end, age = age, fee = fee, barrier = barrier, penalty = penalty)
#Interest rate
r <- constant_parameters$new(0.03)
#Initial value of the underlying fund
spot <- 100
#Volatility
vol <- constant_parameters$new(0.2)
#Dividend rate
div <- constant_parameters$new(0.0)
#Gatherer for the MC point estimates
the_gatherer <- mc_gatherer$new()
#Number of paths to simulate
no_of_paths <- 1e3

#Sets up the pricing engine specifying the va_contract, the interest rate
#the parameters of the Weibull intensity of mortality, the initial fund
#value, the volatility and dividends rate
engine <- va_bs_engine$new(contract, r, c1=90.43, c2=10.36, spot,
volatility=vol, dividends=div)

#Estimates the contract value by means of the static approach.

engine$do_static(the_gatherer, no_of_paths)
the_gatherer$get_results()
#>       mean       se
#> 1 91.84034 1.009428

Release status

Installation

Get valuer from CRAN:

install.packages("valuer")

Get the development release from GitHub:

# install.packages("devtools")

devtools::install_github("IvanZoccolan/valuer")

Build status

References

BMOP2011 - Bacinello A.R., Millossovich P., Olivieri A. e Pitacco E. "Variable annuities: unifying valuation approach." In: Insurance: Mathematics andEconomics 49 (2011), pp. 285-297.

Copy Link

Version

Install

install.packages('valuer')

Monthly Downloads

21

Version

1.1.2

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Ivan Zoccolan

Last Published

February 7th, 2018

Functions in valuer (1.1.2)

GMDB

Variable Annuity with GMDB guarantee
sq

Square root utility function
va_bs_engine

Variable Annuity pricing engine with GBM
GMAB

Variable Annuity with GMAB guarantee
GMAB_GMDB

Variable Annuity with GMAB and GMDB guarantees
payoff_guarantee

Generic guarantee payoff class
payoff_ratchet

Ratchet payoff class
constant_parameters

Constant parameter class
data_gatherer

Simple data gatherer
payoff_rollup

Roll-up of premiums payoff class
penalty_class

Surrender penalty class
mu

Weibull intensity of mortality
payoff_GMWB

GMWB payoff class
va_bs_engine2

Variable Annuity pricing engine with GBM and generic mortality
va_engine

Generic Variable Annuity pricing engine
yr_fractions

Normalizes a timeDate sequence into year fractions
financials_BBM2010

BBM2010 financial processes
financials_BMOP2011

BMOP2011 financial processes
makeham

Makeham's intensity of mortality
va_mkh_engine

Variable Annuity pricing engine with GBM and Makeham
mc_gatherer

Monte Carlo gatherer
va_pde_pricer

PDE Pricing of Variable Annuity
GMWB

Variable Annuity with GMWB guarantee
calc_account

Calculates the account
mortality_BMOP2011

BMOP2011 demographic processes
mortality_BBM2010

BBM2010 demographic processes
va_product

Generic Variable Annuity product class
va_sde_engine

General Variable Annuity pricing engine
va_sde_engine2

Variable Annuity pricing engine with general financial processes and Weibull mortality
va_sde_engine3

Variable Annuity pricing engine with general fund processes and Weibull mortality
GMIB

Variable Annuity with GMIB guarantee
financials_BZ2016

BZ2016 financial processes
financials_BZ2016bis

BZ2016bis financial processes