Range Error while forecasting VAR

For technical support, tips and tricks, suggestions, or any other information regarding the EViews model object.

Moderators: EViews Gareth, EViews Moderator

sri_stat
Posts: 4
Joined: Sun Feb 14, 2010 9:50 pm

Range Error while forecasting VAR

Postby sri_stat » Sun Feb 14, 2010 10:20 pm

Hi, Can any one help me?

I am using EViews6. I want to forecast the future observations in the series of data(undated series). I already fitted the VAR model to this. My problem is I am not able to forecast the values of the series. I am using the following commands.
var mvar.ls 1 !i y x
mvar.makemodel(mod1)
smpl 20 50
mod1.solve

When I try this I am getting the error " Range Error in SMPL 20 50"

I want to forecast the future 20 values. Please note that I have created workfile using "workfile spurious u 1000"
Please let me know where I have done mistake.

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

Re: Range Error while forecasting VAR

Postby EViews Gareth » Mon Feb 15, 2010 9:02 am

There is nothing wrong with the code, as you've posted it. The following is, essentially, what you say you're doing, and it works fine:

Code: Select all

workfile spurious u 1000

series y=nrnd
series x=nrnd

var mvar.ls 1 3 y x
mvar.makemodel(mod1)
smpl 20 50
mod1.solve
Follow us on Twitter @IHSEViews

sri_stat
Posts: 4
Joined: Sun Feb 14, 2010 9:50 pm

Re: Range Error while forecasting VAR

Postby sri_stat » Mon Feb 15, 2010 11:51 pm

Hi Gareth,

Thanks for your reply, I will explain you the error which I am getting a little better.

I have created workfile with 1000 observations.-- workfile spurious u 1000
I have assigned two different series each with 185 observations to "Y and X"
I have written the following code

for !i=2 to 20
var mvar.ls 1 !i y x
if (condition for t-statistic) then
mvar.makemodel(mod1)
smpl 50 70
mod1.solve
exit loop
end if
end if

if I run this i getting error as "Range Error in SMPL 50 70"

If I change the code "smpl 50 70 " to "smpl 20 50" the error I am getting is
"Error in sample:Attempt to set sample outside of workfile range
Structure/Resize (from \WORKFILE\PROC menu) can expand the workfile range. in SMPL 20 50"

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

Re: Range Error while forecasting VAR

Postby EViews Gareth » Tue Feb 16, 2010 11:24 am

As shown in my above code, there is nothing wrong with the way you are setting the sample. Either you do not have the workfile you think you do, or you are doing something else wrong.
Follow us on Twitter @IHSEViews

sri_stat
Posts: 4
Joined: Sun Feb 14, 2010 9:50 pm

Re: Range Error while forecasting VAR

Postby sri_stat » Tue Mar 02, 2010 12:38 am

Hi Gareth,

I found the mistake which I am doing. After creating undated workfile, I am opening the workfiles using filepath. In that open workfile there is a variable with Date series.
Eviews considering it as dated series and giving range error (mentioned earlier) while forecasting VAR.
I need this date series to furnish start and end date of that workfile in my result table.

I have to forecast the VAR eventhough there is a date series in the workfile. Can you please let me know how to over come this?

Please note that I have ro forecast the series not based on Date, based on sample values using the command "smpl 100 120"

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

Re: Range Error while forecasting VAR

Postby EViews Gareth » Tue Mar 02, 2010 8:23 am

You can use the pagestruct command to convert your dated workfile into an undated one.
Follow us on Twitter @IHSEViews

sri_stat
Posts: 4
Joined: Sun Feb 14, 2010 9:50 pm

Re: Range Error while forecasting VAR

Postby sri_stat » Wed Mar 03, 2010 3:30 am

Hi Gareth,

Many thanks for your reply. It is working but I am not able to forecast the out sample. My "sample" and "Range" are becoming equal after fitting the model.
Is it possible to extend the workfile Range in the program before forecasting the out sample values so that Range: will be higher than Sample:?

If so please give the syntax for that.

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

Re: Range Error while forecasting VAR

Postby EViews Gareth » Wed Mar 03, 2010 9:04 am

You can use pagestruct to do that too.
Follow us on Twitter @IHSEViews


Return to “Models”

Who is online

Users browsing this forum: No registered users and 2 guests