rTrajectoryOU {POUMM} | R Documentation |
Generation of a random trajectory of an OU process starting from a given initial state
Description
Generates a trajectory xt given initial state z0 according to an Ornstein-Uhlenbeck process.
Usage
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
z0 <- 0
nSteps <- 100
t <- 0.01
trajectory <- rTrajectoryOU(z0, t, 2, 2, 1, steps = nSteps)
plot(trajectory, type = 'l')
[Package POUMM version 2.1.7 Index]