gen_rw: Generate a Random Walk without Drift

Description Usage Arguments Value Process Definition Generation Algorithm Examples

View source: R/RcppExports.R

Description

Generates a random walk without drift.

Usage

1
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.

Examples

1
gen_rw(10, 8.2)

SMAC-Group/gmwm documentation built on Sept. 11, 2021, 10:06 a.m.