Hi
i need to run a rolling regression for an arma model, forecast and compute the mean squared error.
For example, i take a sample of 100obs from a universe of 1000.
First i run the arma model for 100obs. Then i forecast the Y on t=101, E(Y_101/X_101). After that i compute the mean squared error with the actual observation, Y_100.
I'm not sure how to forecast only one step forward and then check the residual. That residual i'm losing it when i run my code.
Can you help me?
Thanks for your time.
Rolling ARMA and forecast t+1
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Rolling ARMA and forecast t+1
Hard to help without knowing what you've got so far.
Re: Rolling ARMA and forecast t+1
i did something like this
i'm storing the coeficients for AR(1) and MA(1), i mean, i'm saving the estimated parameters for phi and theta for every sample i make with the loop
For example, i estimate an arma process for 100 obs and save phi and theta, then i ran again an estimation for the arma(1,1) but fot 101 obs and i store the phi and theta.
But how do i forecast for, eg, the t=101 using the phi and theta with the regression i did using only 100 obs? In simple words, i need to evaluate the mean squared error doing comparing the fitted v/s actual value at t=101.
The issue here is tha
Code: Select all
!length=@obsrange
vector(!length) const
vector(!length) phi
vector(!length) theta
vector(!length) error
for !i=20 to 20
smpl @first @first+!i
equation eq9c
eq9c.ls rl_dj c ar(1) ma(1)
const(!i-1)=eq9c.@coef(1)
phi(!i-1)=eq9c.@coef(2)
theta(!i-1)=eq9c.@coef(3)
eq9c.makeresid res2
nextFor example, i estimate an arma process for 100 obs and save phi and theta, then i ran again an estimation for the arma(1,1) but fot 101 obs and i store the phi and theta.
But how do i forecast for, eg, the t=101 using the phi and theta with the regression i did using only 100 obs? In simple words, i need to evaluate the mean squared error doing comparing the fitted v/s actual value at t=101.
The issue here is tha
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Rolling ARMA and forecast t+1
To do a forecast you just need to do equation.forecast forecastname. Thus in your case something like:
The forecast will occur over the current workfile sample, so you just have to set the sample to the forecast period you want prior to doing the forecast.
Code: Select all
eq9c.forecast myforc
Who is online
Users browsing this forum: No registered users and 2 guests
