Page 1 of 1

Rolling forecast more than 1 variable

Posted: Mon Jul 29, 2013 9:26 am
by gbc
Hi everyone,

I am trying to perform some rolling forecasts with an equation that include lags of other variables besides the lags of the dependent variable (a multivariate ARMA model I suppose).

I am using the code that first code for roll forecasts that is stored in the sample files of Eviews 8.

Well, those only use one variable. So:

1) I use the import comand to get all the variables I need.
2) I include some more regressors and lags into eq1.

When I run the file, it appears a message saying "unable to compute due to missing data in "Do.eq1forecast(f=na) ..."

What is that?

Everytime I do it without those extra regressors everything goes fine. I am also sure that I have the same number of observations for every variable. Although some of the observ. of the new regressors are "NA"... I find it weird that such could be the problem...

Re: Rolling forecast more than 1 variable

Posted: Mon Jul 29, 2013 9:37 am
by EViews Gareth
The error message says "unable to compute due to missing data in..."

The most likely cause of this is that you have missing data in your regressors...

Re: Rolling forecast more than 1 variable

Posted: Tue Jul 30, 2013 6:38 am
by gbc
Yeah Gareth.

I looked today again at it and I found that in one of the regressors.

Sometimes a good night of sleep changes everything

Thank you

Re: Rolling forecast more than 1 variable

Posted: Tue Apr 19, 2016 5:40 am
by Sammoland
Hi all

I am trying something similar to above. I am running a loop that runs through a number of variables, estimates equations and then produces a forecast for each variable. The trick comes in that the variables update at different times of the year, so at certain times I'll have data for, say 2016m02 for some variables, but 2016m03 for others. The forecast end period remains fixed (e.g. 2016m06) for all variables, so I'm trying to write a piece of code that identifies where the variable's last data point is (2016m01/2016m02/2016m03), run the regression with the sample up to the latest data point, then start the forecast the period following that for each different variable.

In my mind, this seems a straightforward case of identifying each variable @last point in a loop, then estimating the equation and adding "+1" to the sample. Here is the code I have come up with, but eViews has an issue, saying "Illegal date %var.last in smpl 2002m1 "%var.@last". Any advice. Here is a portion of the code:

Code: Select all

for !p=1 to gexp_f.count %var = gexp_f.@seriesname(!p) 'name of var %rolfore= {%var}.@last smpl 2002m1 %rolfore
Once I get over this hurdle, identifying the forecast start should be easy

Re: Rolling forecast more than 1 variable

Posted: Tue Apr 19, 2016 5:47 am
by EViews Gareth

Code: Select all

smpl 2002m1 {%rolfore}

Re: Rolling forecast more than 1 variable

Posted: Tue Apr 19, 2016 5:57 am
by Sammoland
Thanks Gareth.

Re: Rolling forecast more than 1 variable

Posted: Tue Apr 19, 2016 7:16 am
by Sammoland
I seem to have gotten myself confused.

So once I have done the sample adjustment, I need to then set the forecast sample equal to the last date point, "{%rolfore}" +1. I have tried setting the sample in the forecast to {%rolfore}, but I keep getting a message that says "Unable to compute due to missing data in "DO_FORE.FORECAST Y1_F".

I know that there is missing data somewhere, but shouldn't it be the case that each variable ran the equation regression up to the last data point, and then the forecast should be following on from that. This is the code I have been using:

Code: Select all

equation {%eqname}_{%var}.ls dlog({%dep}) {%regs} {%bestlagstr} smpl {%rolfore} %forend {%var} = @nan({%var},0) {%eqname}.forecast {%dep}_f series rm_{%var} = @rmse({%dep},{%dep}_f) next
Any ideas?

Re: Rolling forecast more than 1 variable

Posted: Tue Apr 19, 2016 7:21 am
by EViews Gareth
Impossible to say without the data/program.