SimulateAR1 function

Simulate AR(1) series

Simulate AR(1) series

An AR(1) series with mean zero and variance 1 and with autocorrelation paramater phi is simulated.

SimulateAR1(n, phi)

Arguments

  • n: length of series
  • phi: autocorrelation parameter

Details

The model equation is: z[t] = phi*z[t-1]+a[t], where z[1] is N(0,1) and a[t] are NID(0, siga), siga=(1/(1phi2))siga=\sqrt(1/(1-phi^2)).

Returns

autocorrelated time series of length n

See Also

FitHReg, SimulateHReg

Examples

e<-SimulateAR1(10^4, phi=0.8) mean(e) sd(e) acf(e, lag.max=5, plot=FALSE)
  • Maintainer: M. S. Islam
  • License: GPL (>= 2)
  • Last published: 2016-05-16

Useful links