One step ahead forecast from an estimated model - error term

I have estimated the model for my series and it is arima(1,1,1). Instead of available k-step ahead option, I need to do one-step ahead forecast. The model is:
ARIMA(1,1,1) Model:
--------------------
Conditional Probability Distribution: Gaussian
Standard t
Parameter Value Error Statistic
----------- ----------- ------------ -----------
Constant 8.96034e-05 0.00121444 0.0737815
AR{1} 0.531086 0.0802215 6.62025
MA{1} -0.917878 0.0394706 -23.2548
Variance 0.0378884 0.00419511 9.03158
so, the equation will be
y(k) = .000089 + (0.531086*y(k-1)) + e(k) + (-0.917878*e(k-1))
What will be the value of 'e' term? what should be 'e(k)'? Correct me if I have interpreted anything wrongly.

3 commentaires

na ja
na ja le 17 Sep 2016
Modifié(e) : na ja le 17 Sep 2016
And I also want o know what should be MA term sign,+ve or -ve? i.e. loke above eqn. or
y(k) = .000089 + (0.531086*y(k-1)) + e(k) - (-0.917878*e(k-1)) ?
As d = 1 in my model,should I consider it as below?
[y(k) - y(k-1)] = .000089 + [0.531086*(y(k-1) - y(k-2))] + e(k) + (-0.917878*e(k-1))
what about e(k), e(k-1) terms?
Yes the model w ould be:
y(k) = .000089 + y(k-1) + [0.531086*(y(k-1) - y(k-2))] + e(k) + (-0.917878*e(k-1))
e(k) in this example is simply a Normal random variable with mean zero and variance 0.038 such e(k) is independent of e(k-t)) for all t.
Look at the forecast method, you should provide the pre-sample response 'Y0' and innovations 'E0'.
doc arima\forecast
Forecast provides MLE (i.e. all e sampled will be zero), but you can also use the simulate method to sample from that distribution:
doc arima\simulate
Thanks Brendan! Will do the same. I have one more doubt regarding statistical concept of ARIMA. As I have discussed above, this model is ARIMA(1,1,1). For one step ahead forecast I am using the equation
[y(k) - y(k-1)] = .000089 + [0.531086*(y(k-1) - y(k-2))] + e(k) + (-0.917878*e(k-1))
What will be the value of e(k-1) term to get 1st forecast (i.e. for k =1)? Is it the last value of residual matrix of training data or something else? I am bothered because according to the equation, i am predicting differences, not the actual values. The residual table gives the residuals for (actual values- predicted values).

Connectez-vous pour commenter.

 Réponse acceptée

Brendan Hamm
Brendan Hamm le 22 Sep 2016
Modifié(e) : Brendan Hamm le 24 Sep 2016
1. The arima\estimate method will return to you the data on the original scale. That is if you do:
Mdl = arima(1,1,1);
Mdl = estimate(Mdl,data);
res = infer(Mdl,data); % Retrieve inferred residuals (innovations)
foreValues = forecast(Mdl,1,'Y0',data','E0',res) % forecast
Your forecasted data will be on the same scale as data and not the differenced data. The difference operator is just applied and you have the model you wrote above, but are simply returned y(k),y(k+1),...
2. The residual e(k-1) is he last value in the variable res above. That is, if you pass 'E0' to the forecast method it will use the residuals which were infered from the model and data.

5 commentaires

na ja
na ja le 23 Sep 2016
Modifié(e) : na ja le 23 Sep 2016
That's right!
Actually I predicted the model using the same approach.
What I want to implement is one step ahead forecast. For this, the equation is as discussed above. As I am predicting the difference and not the actual value, my error term should be the residuals obtained from differences and not the actual value. 'infer' fits model in terms of original series, which is not appropriate in my case. I have found the previous residual terms using one step ahead approach, as discussed below.
The training data 'y' is of 200 values. So, total differenced terms 'dy' will be 199. To forecast 200th differenced value, e(k-1) = e(199) is needed..
ARIMA Equation is [y(k) - y(k-1)] = .000089 + [0.531086 * (y(k-1) - y(k-2))] + e(k) + [-0.917878*e(k-1)]
forecast = 0; // As no past value is available for forecast, initial value is 0 // _
for
k = 1:199 // total 199 differenced terms//
error(k) = dy(k) - forecast; // find residual//
next_forecast(k) = .000089 + (0.531086 * dy(k) ) +(-0.917878) *error(k); //next forecast
forecast = next_forecast(k); // update forecast value
end
Now last value of error(k) will be the first residual value e(k-1) for next forecast , which is implemented for 50 points of test data, one-step ahead .
Is this right??
And one more thing, I have considered e(k) = 0, will it make much difference?
You are correct that the last value of error calculated from infer will be the first residual value e(k-1) in the forecast.
You do have the appropriate formula, but you will not however be forecasting the difference [y(k)-y(k-1)]. Instead you would be forecasting on the scale of the original data y(k).
If you wish to forecast [y(k)-y(k-1)], then fit an undiffereced model on the differenced data:
diffData = diff(data);
Mdl = arima(1,0,1);
Mdl = estimate(Mdl,diffDatata);
res = infer(Mdl,diffData); % Retrieve inferred residuals (innovations)
foreValues = forecast(Mdl,1,'Y0',data','E0',res) % forecast of differenced data
Using that e(k) = 0 does not make much of a difference as the forecast is the "best guess" at what will happen given a N(0,Mdl.Variance) distribution. This would matter more if you were trying to Monte Carlo sample some paths for another purpose ... but it seems a 1-step ahead prediction is your goal, so there are no issues with this.
Thanks Brendan! That made it all clear. :)
Thank you for this answer! Can you then plot the forecasted values combined with the observed values so that we get a graph were we see the continuity between observed and forecasted values?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by