data.gen.rw {synthesis}R Documentation

Generate Random walk time series.

Description

Generate Random walk time series.

Usage

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

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)

[Package synthesis version 1.2.5 Index]