Automating Overrides

For questions regarding programming in the EViews programming language.

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

caburdick
Posts: 24
Joined: Mon Jun 15, 2009 7:41 am

Automating Overrides

Postby caburdick » Wed Aug 19, 2009 11:37 am

Is there any way to automate creation of the list of variable overrides in model scenarios? What I would like to do is specify a list of exogenous regressors in a var model that are autoatically included as scenario overrides

group exog_reg u v w
var myvar.ls 1 2 x y z @ c q2 q4 exog_reg
myvar.makemodel(mymod)
mymod.scenario(n,a="_s1")
mymod.override u v w
mymod.solve

Specifically, how can I automate the line

mymod.override u v w

so that it reads the overrides directly from the group exog_reg?

I've tried

mymod.override exog_reg

for !i = 1 to exog_reg.@count
mymod.override(m) exog_reg.@seriesname(!i)
next !i

for !i = 1 to exog_reg.@count
%oride = exog_reg.@seriesname(!i)
mymod.override(m) %oride
next !i

but none of these solutions work. Would an alpha lsit or a table do the trick? Or, is there no way to pass a list of variables to a scenario override without having to hardcode it?

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

Re: Automating Overrides

Postby EViews Gareth » Wed Aug 19, 2009 11:50 am

Without trying it myself, I'd be surprised if:

Code: Select all

for !i = 1 to exog_reg.@count
%oride = exog_reg.@seriesname(!i)
mymod.override(m) {%oride}
next !i


didn't work.
Follow us on Twitter @IHSEViews

caburdick
Posts: 24
Joined: Mon Jun 15, 2009 7:41 am

Re: Automating Overrides

Postby caburdick » Wed Aug 19, 2009 12:09 pm

Thanks Gareth! That worked, And DOH! to me for forgetting the braces...


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 39 guests