[R] R: lags

Anders Nielsen anielsen at math.ku.dk
Tue Feb 10 16:09:23 CET 2004


How about:

y<-cumsum(c(0,rnorm(100)))



On Tue, 10 Feb 2004, allan clark wrote:

> hi all
>
> 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.
>
> Regards
> allan
>




More information about the R-help mailing list