[R] R: lags

ekstrom@dina.kvl.dk ekstrom at dina.kvl.dk
Tue Feb 10 16:11:51 CET 2004


> how does one simulate a random walk process?
> 
> i.e
> 
> y(0)=0
> 
> y(t)=y(t-1)+ e(t)
> 
> where e(t) is normal(0,1)  say.

cumsum(c(0,rnorm(10000)))

?

Claus

-- 
*****************************************
Claus Thorn Ekstrøm <ekstrom at dina.kvl.dk>
Dept of Mathematics and Physics, KVL
Thorvaldsensvej 40
DK-1871 Frederiksberg C
Denmark
Phone:[+45] 3528 2341
Fax:  [+45] 3528 2350




More information about the R-help mailing list