data.gen.rw: Generate Random walk time series.

Description Usage Arguments Value References Examples

View source: R/data_gen_RW.R

Description

Generate Random walk time series.

Usage

1
data.gen.rw(nobs, drift = 0.2, sd = 1)

Arguments

nobs

the data length to be generated

drift

drift

sd

the white noise in the data

Value

A list of 2 elements: random walk and random walk with drift

References

Shumway, R. H. and D. S. Stoffer (2011). Time series regression and exploratory data analysis. Time series analysis and its applications, Springer: 47-82.

Examples

1
2
3
4
set.seed(154)
data.rw <- data.gen.rw(200)
plot.ts(data.rw$xd, ylim=c(-5,55), main='random walk', ylab='')
lines(data.rw$x, col=4); abline(h=0, col=4, lty=2); abline(a=0, b=.2, lty=2)

synthesis documentation built on May 3, 2021, 9:07 a.m.