I'm new to forecasting and I'm trying to use the forecast package in r.
Can someone please explain the difference between mean and fitted in the forecast function?
For example,
fcast<-forecast(ts,h=30)
fcast$mean
fcast$fitted
The documentation says "mean is Point forecasts as a time series" and "fitted is Fitted values (one-step forecasts)".
An example to illustrate the difference would be great. Any help much appreciated.
fcast$fitted
is the result of the fit (the model fitted to observation) andfcast$mean
is the result of the forecast (the application of the model to the future). You can comparelength(ts)
andlength(fcast$fitted)
. Andlength(fcast$mean)
and theh
you choose.