Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gen_rw

Generate a Random Walk without Drift


Description

Generates a random walk without drift.

Usage

gen_rw(N, sigma2 = 1)

Arguments

N

An integer for signal length.

sigma2

A double that contains process variance.

Value

grw A vec containing the random walk without drift.

Process Definition

Random Walk (RW) with parameter gamma in R^{+}. This process is defined as:

X[t] = sum(gamma*Z[t])

and is often called Rate Random Walk in the engineering literature.

Generation Algorithm

To generate we first obtain the standard deviation from the variance by taking a square root. Then, we sample N times from a N(0,sigma^2) distribution. Lastly, we take the cumulative sum over the vector.


simts

Time Series Analysis Tools

v0.1.1
AGPL-3 | file LICENSE
Authors
Stéphane Guerrier [aut, cre, cph], James Balamuta [aut, cph], Roberto Molinari [aut, cph], Justin Lee [aut], Yuming Zhang [aut], Wenchao Yang [ctb], Nathanael Claussen [ctb], Yunxiang Zhang [ctb], Christian Gunning [cph], Romain Francois [cph], Ross Ihaka [cph], R Core Team [cph]
Initial release
2019-07-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.