Learn R Programming

Sim.DiffProc (version 2.5)

HWV: Creating Hull-White/Vasicek (HWV) Gaussian Diffusion Models

Description

Simulation the Hull-White/Vasicek or gaussian diffusion models.

Usage

HWV(N, t0, T, x0, theta, r, sigma, output = FALSE)

Arguments

N
size of process.
t0
initial time.
T
final time.
x0
initial value of the process at time t0.
theta
constant (theta is the long-run equilibrium value of the process and r*(theta -X(t)) :drift coefficient).
r
constant positive (r is speed of reversion and r*(theta -X(t)):drift coefficient).
sigma
constant positive (sigma (volatility) :diffusion coefficient).
output
if output = TRUE write a output to an Excel (.csv).

Value

  • data.frame(time,x) and plot of process.

Details

The Hull-White/Vasicek (HWV) short rate class derives directly from SDE with mean-reverting drift: $$dX(t) = r * (theta - X(t)) * dt + sigma * dW(t)$$ With r *(theta- X(t)) :drift coefficient and sigma : diffusion coefficient, W(t) is Wiener process, the discretization dt = (T-t0)/N. The process is also ergodic, and its invariant law is the Gaussian density.

See Also

HWVF Flow of Gaussian Diffusion Models, PEOUG Parametric Estimation of Hull-White/Vasicek Models, snssde Simulation Numerical Solution of SDE.

Examples

Run this code
## Hull-White/Vasicek Models
## dX(t) = 4 * (2.5 - X(t)) * dt + 1 *dW(t)
 HWV(N=1000,t0=0,T=1,x0=10,theta=2.5,r=4,sigma=1)
## if theta = 0 than "OU" = "HWV"
## dX(t) = 4 * ( 0 - X(t)) * dt + 1 *dW(t)
 system.time(OU(N=10^4,t0=0,T=1,x0=10,r=4,sigma=1))
 system.time(HWV(N=10^4,t0=0,T=1,x0=10,theta=0,r=4,sigma=1))

Run the code above in your browser using DataLab