[R] R: lags

Peter Dalgaard p.dalgaard at biostat.ku.dk
Tue Feb 10 17:50:19 CET 2004


allan clark <allan at stats.uct.ac.za> writes:

> 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.

E.g.,

c(0,cumsum(rnorm(1000)))

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list