3
$\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$
  • $\begingroup$ What do you mean by "ARIMA simulation"? $\endgroup$ – TPArrow Jun 24 '15 at 18:18
3
$\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, privacy policy and cookie policy

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