Learn R Programming

SMFI5 (version 1.0)

bond.vasicek: Simulates the values and yields of zero-coupon bonds when the spot rate is modeled by a Ornstein-Uhlenbeck process

Description

Simulates the values and yields of zero-coupon bonds when the (annualized ) spot rate (in percent) is modeled by a Ornstein-Uhlenbeck process satisfying dr <- alpha(beta-r)dt + sigma dW, with market price of risk q(r) <- q1+q2 r. The maturities are 1,3,6 and 12 months.

Usage

bond.vasicek(alpha, beta, sigma, q1, q2, r0, n, maturities, days = 360)

Arguments

alpha
Mean-reversion parameter.
beta
Long term mean.
sigma
Volatility parameter.
q1
Market prime of risk parameter.
q2
Market prime of risk parameter.
r0
Initial rate value.
n
Number of periods.
maturities
Maturities in years (row vector).
days
Days in a year convention (360 default).

Value

P
Bond values.
R
Annual rate for the bond.
tau
Maturities in years.

References

Chapter 5 of 'Statistical Methods for Financial Engineering, B. Remillard, CRC Press, (2013).

Examples

Run this code
out = bond.vasicek(0.5,2.55,0.365,0.3,0,3.55,1080,c(1/12, 3/12, 6/12, 1),365);

Run the code above in your browser using DataLab