Let's have a stationary data with 100 elements. Let's use the first 70 for defining an appropriate ARIMA model (EstMdl), and use the last 30 for tests. Test 1: infering residuals for the last 30 elements: E = infer(EstMdl,data(71:100),'Y0',dat(1:70)); Test 2: forecasting the last 30 elements: OUT = forecast(EstMdl,30,'Y0',dat(1:70)); then determining the residual as: res = data(71:100)-OUT;
According to my understanding, res should be equal to E. But they are not. Why?