data.gen.rw | R Documentation |
Generate Random walk time series.
data.gen.rw(nobs, drift = 0.2, sd = 1)
nobs |
the data length to be generated |
drift |
drift |
sd |
the white noise in the data |
A list of 2 elements: random walk and random walk with drift
Shumway, R. H. and D. S. Stoffer (2011). Time series regression and exploratory data analysis. Time series analysis and its applications, Springer: 47-82.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.