iratemodel: Interest Rate Model

Description Usage Details References Examples

Description

A class used to describe the interest rate we are modeling. Six types of interest rate models can be used to model the force of interest δ_{s} (see Parker (1992)):

1. Deterministic interest rate, i.e. the determ class. For the determinstic interest rate, the params argument should be a list with delta for the interest rate. The class argument should be "determ". See the examples below.

2. Wiener process, i.e. the wiener class. For the wiener process, the params argument should be a list with delta for the long term mean and sigma for the local volatility. The class argument should be "wiener". See the examples below.

3. Ornstein-Uhlenbeck process, i.e. the ou class. For the Ornstein-Uhlenbeck process, the params should be a list with delta for the long term mean, alpha for the friction parameter, sigma for the local volatility and delta0 for the initial value of the process. The class argument should be "ou". See the examples below.

4. Second Order Stochastic Differential Equation, i.e. the second class. For the second order process, the params should be a list with delta for the long term mean, alpha1 for the first friction parameter, alpha2 for the second friction parameter, sigma for the local volatility, delta0prime for the initial derivative of the process and and delta0 for the initial value of the process. Note that Parker uses the notation of alpha0 instead of alpha2 but note that we are referring to the same parameter. The class argument should be "second". See the examples below.

5. AR(1) process, i.e. the ar1 class. For the AR(1) process, the params should be a list with delta for the long term mean, delta0 for the initial value of the process, phi1 for the AR(1) coefficient and sigma for the local volatility. The class argument should be "ar1". See the examples below.

6. ARMA(2,1) process, i.e. the arma class. For the ARMA(2,1) process, the params should be a list with delta for the long term mean, delta0 for the initial value of the process, phi1 for the AR(1) coefficient, phi2 for the AR(2) coefficient, theta1 for the MA(1) coefficient and sigma for the local volatility. The class argument should be "arma".

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
iratemodel(params, class)

iratemodel.convert(from, to, irm, Delta = 1)

delta.ev(t, irm)

delta.cov(s, t, irm)

delta.var(t, irm)

y.ev(t, irm)

y.var(t, irm)

y.cov(s, t, irm)

pv.moment(t, moment, irm)

pv.ev(t, irm)

pv.var(t, irm)

pv.cov(s, t, irm)

Details

Define:

y(t) = int_{0}^{t} δ_{s}

pv(t) = exp{-y(t)}

For each class, several functions are available.

The delta.ev function can be used to calculate the expected value of the interest rate process at time t, the delta.var function can be used to calculate of the interest rate process at time t and delta.cov can be used to calculate the covariance of the interest rate process at two times s and t.

The y.ev function can be used to calculate the expected value of the y at time t, the y.var function can be used to calculate of variance of y at time t and y.cov can be used to calculate the covariance of y at two times s and t.

The pv.moment can be used to calculate the raw moments of the present value random variable, pv.ev can be used to calculate the expected value of the present value random varaible, pv.var can be used to calculate the variance of the present value random variable and pv.cov can be used to calculate the covariance of the present value random variable at two times s and t.

The ann.ev function can be used to calculate the expected value of an n-year annuity and ann.var can be used to calculate the variance of an n-year annuity.

The iratemodel.convert function can be used to convert between these interest rate models using the principle of covariance equivalence.

Refer to the examples below for how to use these functions.

References

Parker, Gary. An application of stochastic interest rate models in life assurance. Diss. Heriot-Watt University, 1992.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
## 1. Deterministic interest rate
determodel = iratemodel(list(delta = 0.06), "determ")
delta.ev(5, determodel) # expected value

## 2. Wiener process
wienermodel = iratemodel(list(delta = 0.05, sigma = 0.01), "wiener")
pv.ev(10, wienermodel) # expected present value
pv.var(10, wienermodel) # variance of present value
pv.cov(5,10,wienermodel) # covariance of present value

## 3. Ornstein-Uhlenbeck process
oumodel = iratemodel(list(delta0 = 0.08, delta = 0.05, 
alpha = 0.1, sigma = 0.01), "ou")
delta.ev(5, oumodel)
delta.var(5, oumodel)
y.ev(10, oumodel)
y.var(10, oumodel)
y.cov(5, 10, oumodel)
pv.ev(10, oumodel)
pv.var(10, oumodel)
pv.cov(5, 10, oumodel)

## 4. Second Order Stochastic Differential Equation
secondmodel = iratemodel(params = list(alpha1 = -0.50, alpha2 = -0.04, 
delta0prime = 0.05, delta0 = 0.10, delta = 0.06, sigma = 0.01), "second")

## 5. AR(1) Process
ar1model = iratemodel(params = list(delta = 0.05, delta0 = 0.08,
phi1 = 0.90, sigma = 0.01), "ar1")
delta.ev(5, ar1model)
delta.var(5, ar1model)
delta.cov(5, 10, ar1model)
ann.ev(5, ar1model)
ann.var(5, ar1model)

## 6. ARMA(2,1) Process
armamodel = iratemodel(params = list(delta = 0.05, delta0 = 0.08,
phi1 = 1.05, phi2 = -0.095, theta1 = -0.05, sigma = 0.01), "arma")

## Convert from one model to another
sdemodel = iratemodel.convert("arma", "second", armamodel, 5)
armamodel = iratemodel.convert("second", "arma", sdemodel, 5)

oumodel = iratemodel.convert("ar1", "ou", ar1model, 1/12)

nathanesau/stocins documentation built on May 23, 2019, 12:19 p.m.