Learn R Programming

RTL (version 1.3.0)

simOUt: OU process simulation

Description

Simulates a Ornstein–Uhlenbeck process with mu as a function of time

Usage

simOUt(
  nsims = 2,
  S0 = 0,
  mu = dplyr::tibble(t = 0:20, mr = c(rep(2, 7), rep(4, 14))),
  theta = 12,
  sigma = 0.2,
  T2M = 1,
  dt = 1/12
)

Value

A numeric vector of simulated values

Arguments

nsims

number of simulations. Defaults to 2

S0

S at t=0

mu

data frame of mean reversion level as a function of time

theta

Mean reversion speed

sigma

Standard deviation

T2M

Maturity in years

dt

Time step size e.g. 1/250 = 1 business day.

Author

Philippe Cote

Examples

Run this code
mu = dplyr::tibble(t = 0:20,mr = c(rep(2,7),rep(4,14)))
simOUt(nsims = 2, S0 = 5, mu = mu, theta = .5, sigma = 0.2, T2M = 1, dt = 1 / 12)

Run the code above in your browser using DataLab