Page 1 of 1

Automating Overrides

Posted: Wed Aug 19, 2009 11:37 am
by caburdick
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?

Re: Automating Overrides

Posted: Wed Aug 19, 2009 11:50 am
by EViews Gareth
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.

Re: Automating Overrides

Posted: Wed Aug 19, 2009 12:09 pm
by caburdick
Thanks Gareth! That worked, And DOH! to me for forgetting the braces...