## Solving for the addin factors for a group of trajectories

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

Moderators: EViews Gareth, EViews Moderator

renjinlu
Posts: 14
Joined: Tue Jan 06, 2009 8:34 pm

### Solving for the addin factors for a group of trajectories

Hi, I have a question regarding add-in factors.
Using the Macromod workfile in our Eviews manual as an example. Suppose I give the model (with three equations for CN, R, I and one identity) a name "lalatest", and in baseline scenario, I solved for the static solution

lalatest.scenario "baseline"
smpl 1960q1 1999q4
lalatest.solve(d=s, o=g)

And then I created a comparison scenario with a dynamic solution

lalatest.scenario(n) "comparison1"
lalatest.solve(d=d,o=g)

Obviously, the dynamic and static solutions are different, and I want to use the addin factors to make the "comparison 1" scenario dynamic solution the same as the baseline. Here is what I did:

lalatest.control cn_a cn cn_0 'Solve for the addin factor for CN
lalatest.control i_a i i_0 'Solve for the addin factor of I
lalatest.control r_a r r_0 'Solve for the add in factor for r
lalatest.control y_a y y_0 'Solve for the add in factor for y

lalatest.solve(d=d,o=g)

Unfortunately, it does not work. How can I make the solution of a model, with interactive equations in the model, equal to a set of trajectories? Thank you for your help!

EViews Chris
EViews Developer
Posts: 161
Joined: Wed Sep 17, 2008 10:39 am

### Re: Solving for the addin factors for a group of trajectories

I think the following approach will do what you asked for, although I'm not entirely sure what you're trying to achieve.

Try out the code below and see what you think.

Code: Select all

`lalatest.scenario "baseline"smpl 1960q1 1999q4lalatest.solve(d=s, o=g) 'create a comparison scenario with a dynamic solutionlalatest.scenario(n) "comparison1"lalatest.solve(d=d,o=g) 'obviously, the dynamic and static solutions are different, and I want to use the addin factors to make the "comparison 1" scenario dynamic solution the same as the baselinelalatest.addassign(v) @all 'create addin factors'back up actualscopy cn cnbcopy i ibcopy r rbcopy y yb'overwrite actuals with scenario 1cn = cn_0i = i_0r = r_0y = y_0'solve for add factorslalatest.addinit(v=n) @stochastic'restore actualscn = cnbi = ibr = rby = yb'solve with add factorslalatest.solve(d=d,o=g)'show results: cn_2 should equal cn_0show cn cn_0 cn_a cn_2`

renjinlu
Posts: 14
Joined: Tue Jan 06, 2009 8:34 pm

### Re: Solving for the addin factors for a group of trajectories

Cool! It worked perfectly. You saved me a lot of time. Thanks!