Page 1 of 1

Adding and initializing add factors

Posted: Tue Nov 30, 2010 12:53 am
by jhkemp
Hi,

I want to add add-factors to a model object. I am using the following code:\


eq_{%0}_{%2}.makemodel(model{%0})
model{%0}.addassign(v) {%0}
model{%0}.addinit(v=n, s=b) {%0}

model{%0}.solveopt(s=d, d=d, a=t )
model{%0}.scenario(a) "Scenario 1"
model{%0}.scenario scenario 1
model{%0}.override {%1}
model{%0}.scenario baseline
solve model{%0}

where the %0 and %1 are arguments passed to the program in which this code is nested.

When calling the program, the add factors are not assigned or initialized. Any suggestions?

Re: Adding and initializing add factors

Posted: Tue Nov 30, 2010 9:03 am
by EViews Gareth
If I run the following:

Code: Select all

create u 100 series x=nrnd series x_1 = x+3 series y=nrnd series w=nrnd equation eq_y_2.ls y c x w %0="y" %1="x" %2="2" eq_{%0}_{%2}.makemodel(model{%0}) model{%0}.addassign(v) {%0} model{%0}.addinit(v=n, s=b) {%0} model{%0}.solveopt(s=d, d=d, a=t ) model{%0}.scenario(a) "Scenario 1" model{%0}.scenario scenario 1 model{%0}.override {%1} model{%0}.scenario baseline solve model{%0}
Then add-factors are being assigned. I think this is identical to what you're doing.