I want to simulate this AR process $$X_t=0.7X_{t-1}+\varepsilon_t$$

What is the difference between functions filter() and arima.sim()?

For example this code:

w = rnorm(500,0,1)
x=filter(w, filter=c(.7), method="recursive")

and this code

xarima=arima.sim(n=500, list(ar=c(0.7)), sd=1)
  • $\begingroup$ arma.sim is not part of base R. What package is it in? What does its manual page say that it does? $\endgroup$ – whuber Mar 11 '16 at 16:04
  • 1
    $\begingroup$ @whuber I think that's a typo, the code block shows use of arima.sim() and the arguments are what i would expect for that function. $\endgroup$ – Gavin Simpson Mar 11 '16 at 16:31
  • $\begingroup$ it is in the stats package $\endgroup$ – user44677 Mar 11 '16 at 17:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.