In R plot arima fitted model with the original series

This question is fairly open ended, but here is a very, very basic answer. Starting directly from one of the examples provided in the help files for Arima in the forecast package:

fit <- Arima(WWWusage,order=c(3,1,0))

You say you want the original series in red and the fitted series in blue:

plot(fit$x,col="red")
lines(fitted(fit),col="blue")

which produces a plot that looks something like this:

arima


The differences you are finding are because the arima() function is different from the Arima() function. The former is contained in the basis stats package, the lattercomes from the package forecast and includes the fitted() function to predict over the observed values.

Tags:

R

Time Series