Trying to manually calculate the fitted values from arima in R in order to understand the model. What I am finding is that even though I have not yet learned to calculate the first p values in a AR(p) or MA(p) model, even when I take values returned from arima the first few fitted values dont seem to match. What am I doing wrong?
R Code:
install.packages("forecast")
library(forecast)
wineindT<-window(wineind, start=c(1987,1), end=c(1994,8))
write.table(wineindT,"clipboard",sep="\t")
mod3<-Arima(wineindT,order=c(0,0,1))
mod3$coef
write.table(mod3$coef,"clipboard",sep="\t")
write.table(forecast.Arima(mod3,1)$fitted,"clipboard",sep="\t")
forecast.Arima(mod3,1)$fitted
mod3$residuals
write.table(mod3$residuals,"clipboard",sep="\t")
Here is an Excel calculation: Given the first residual (from arima) my calculation is off for series value 2 and 3 then is correct.
