Let y
contain the time series \(y_1,\dots,y_T\). Then
forecastfunction
is applied successively to the time series
\(y_1,\dots,y_t\), for \(t=1,\dots,T-h\), making predictions
\(\hat{y}_{t+h|t}\). The errors are given by \(e_{t+h} =
y_{t+h}-\hat{y}_{t+h|t}\). These are returned as a
vector, \(e_1,\dots,e_T\). The first few errors may be missing as
it may not be possible to apply forecastfunction
to very short time
series.