5
$\begingroup$

I've been using the R forecast package's auto.arima() function to fit an ARIMA model to my time series data. I want to see how good of a fit the ARIMA model is to my original data. I hope to plot my original time series and the ARIMA simulation on the same plot and see how well they match up. How can I do this?

Thanks!

$\endgroup$
1
  • $\begingroup$ What do you mean by "ARIMA simulation"? $\endgroup$
    – TPArrow
    Commented Jun 24, 2015 at 18:18

1 Answer 1

6
$\begingroup$

That is easy: I show you with an example

library(forecast)
y=arima.sim(list(ar=.9),n=100)
arm=auto.arima(x=y)
matplot(cbind(y,fitted(arm)),type='l')

Or if you want them on the same plot:

plot(y)
lines(fitted(arm), col='red')
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.