simOU: OU process simulation

View source: R/simOU.R

simOUR Documentation

OU process simulation

Description

Simulates a Ornstein–Uhlenbeck process

Usage

simOU(
  nsims = 2,
  S0 = 5,
  mu = 5,
  theta = 0.5,
  sigma = 0.2,
  T2M = 1,
  dt = 1/12,
  epsilon = NULL
)

Arguments

nsims

number of simulations. Defaults to 2. numeric

S0

S at t=0. numeric

mu

Mean reversion level. numeric

theta

Mean reversion speed. numeric

sigma

Standard deviation. numeric

T2M

Maturity in years. numeric

dt

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

epsilon

Defaults to NULL function generates its own. numeric OPTIONAL: Array of epsilons for nsims = 1, if you want to feed your own e.g. in a multivariate context.

Value

Simulated values. tibble

Author(s)

Philippe Cote

Examples

simOU(nsims = 5, S0 = 5, mu = 5, theta = .5, sigma = 0.2, T2M = 1, dt = 1 / 12, epsilon = NULL)
simOU(nsims = 1, S0 = 5, mu = 5, theta = .5, sigma = 0.2, T2M = 1, dt = 1 / 12,
epsilon = matrix(rnorm(12,0,sqrt(1/12))))
simOU(nsims = 2, S0 = 5, mu = 5, theta = .5, sigma = 0.2, T2M = 1, dt = 1 / 12,
epsilon = replicate(2,rnorm(12,0,sqrt(1/12))))

RTL documentation built on May 29, 2024, 2:26 a.m.