rTrajectoryOU: Generation of a random trajectory of an OU process starting...

Description Usage Arguments Value Examples

View source: R/paramsPOUMM.R

Description

Generates a trajectory xt given initial state z0 according to an Ornstein-Uhlenbeck process.

Usage

1
rTrajectoryOU(z0, t, alpha, theta, sigma, steps = 1)

Arguments

z0

Numeric value, initial state.

t

Numeric value or vector of size steps, denoting the time-step(s).

alpha, theta, sigma

Numeric values, parameters of the OU process.

steps

Integer, number of steps.

Value

A numeric vector of length steps containing the generated values at times 0+t, 0+2t, ..., 0+steps*t.

Examples

1
2
3
4
5
z0 <- 0
nSteps <- 100
t <- 0.01
trajectory <- rTrajectoryOU(z0, t, 2, 2, 1, steps = nSteps)
plot(trajectory, type = 'l')

venelin/POUMM documentation built on Oct. 25, 2020, 12:07 a.m.