Rolling forecast more than 1 variable

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

gbc
Posts: 4
Joined: Mon Jul 22, 2013 5:48 am

Rolling forecast more than 1 variable

Postby gbc » Mon Jul 29, 2013 9:26 am

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...

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13583
Joined: Tue Sep 16, 2008 5:38 pm

Re: Rolling forecast more than 1 variable

Postby EViews Gareth » Mon Jul 29, 2013 9:37 am

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...

gbc
Posts: 4
Joined: Mon Jul 22, 2013 5:48 am

Re: Rolling forecast more than 1 variable

Postby gbc » Tue Jul 30, 2013 6:38 am

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

Sammoland
Posts: 18
Joined: Tue Mar 01, 2016 6:41 am

Re: Rolling forecast more than 1 variable

Postby Sammoland » Tue Apr 19, 2016 5:40 am

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13583
Joined: Tue Sep 16, 2008 5:38 pm

Re: Rolling forecast more than 1 variable

Postby EViews Gareth » Tue Apr 19, 2016 5:47 am

Code: Select all

smpl 2002m1 {%rolfore}

Sammoland
Posts: 18
Joined: Tue Mar 01, 2016 6:41 am

Re: Rolling forecast more than 1 variable

Postby Sammoland » Tue Apr 19, 2016 5:57 am

Thanks Gareth.

Sammoland
Posts: 18
Joined: Tue Mar 01, 2016 6:41 am

Re: Rolling forecast more than 1 variable

Postby Sammoland » Tue Apr 19, 2016 7:16 am

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?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13583
Joined: Tue Sep 16, 2008 5:38 pm

Re: Rolling forecast more than 1 variable

Postby EViews Gareth » Tue Apr 19, 2016 7:21 am

Impossible to say without the data/program.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests