Help with VAR forecast Addin

For questions about EViews Add-ins available from the EViews Add-ins webpage. Note each add-in available on our webpage will have its own individual thread.

Moderators: EViews Gareth, EViews Moderator, EViews Esther

oren7171
Posts: 4
Joined: Fri Sep 12, 2014 2:47 am

Help with VAR forecast Addin

Postby oren7171 » Tue Mar 17, 2015 6:06 am

Hi,
I am currently working on programming a VAR one-step ahead forecast using a rolling window (static):

Code: Select all

for !i = 1 to @obsrange-!windowlength

'Set sample to estimation period (window)
smpl !i @first+!i+!window-2

for !p = 1 to !max_lag
var var_test{!p}.ls !p !p hours

'set sample to forecast period (one-step-ahead)
smpl !i+1 @first+!i+!window-1
var_test{!p}.fcast(s) _f _se
next
next


Where:
!windowlength: is the length of the moving window
hours: a group of the relevant series.

I have several issues:
1. Whenever specifying a static forecast, I received an error message saying 'Not enough observations'.

2. When I use a dynamic forecast, the program generates series _vh / _vl / _vm / _vs => What are these series? They are all simply NA.

3. When a dynamic forecast is used, after the first window the program pops an error message "Series X already exists" - Is there a way to extract these forecasts to an external series rather than the ones used in the Add In?

Thank you!
Oren

CharlieEVIEWS
Posts: 202
Joined: Tue Jul 17, 2012 9:47 am

Re: Help with VAR forecast Addin

Postby CharlieEVIEWS » Tue Mar 17, 2015 12:11 pm

There are a few things going on here.

1.) You use !windowlength then !window. Neither of which are specified in the code you provided.

2.) This is likely causing problems with @first+!i+!window-2 (causing the end of the sample to be before the start?) - why are you using -2?

3.) In line 7 its likely you want:

Code: Select all

var var_test{!p}.ls 1 !p hours


4.) _vh / _vl / _vm / _vs relate to the SE error outputs (higher/lower bounds etc). They will only appear when your workfile creates an error in between the place where they are being created and where they are deleted in the addin prg.

5.) To overcome the 'series already exists' problem, you need to make sure your forecasts have different (i.e. are generated dynamically) names. Try something like:

Code: Select all

ar_test{!p}.fcast(s) _f_{!i} _se_{!i}


There's probably some more stuff going on, but without you being clearer with what specific forecasts you want to generate, its hard to help further. smpl settings look weird though.

Charlie

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

Re: Help with VAR forecast Addin

Postby EViews Gareth » Tue Mar 17, 2015 1:47 pm

I'll also point out that you're probably much better off doing the forecast with a model object yourself, rather than calling the Add-in. The Add-in adds tons of unnecessary overhead, and will really slow up your program.
Follow us on Twitter @IHSEViews


Return to “Add-in Support”

Who is online

Users browsing this forum: No registered users and 24 guests