Initialize Add Factor so model solves the target variable

For questions regarding programming in the EViews programming language.

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

temp01
Posts: 17
Joined: Tue Apr 03, 2012 3:04 am

Initialize Add Factor so model solves the target variable

Postby temp01 » Tue Apr 03, 2012 3:16 am

Hello everyone. I have been reading this forum for information since I recentlty got into eviews and thought I would ask for help in a problem I have as this forum has always been my first point of reference in looking up eviews questions on the net. I use Eviews 7.

I am trying to find the programming code for the following eviews command:

Add Factors --> Initialize Add Factor --> So model solves the target variable series1 to the value of the trajectory series series1_trajectory

It would be nice to know if it can be done for multiple time series.

What I have done so far to emulate this is written some code that iterates through the possible add factor values in several steps, solves the model and finds the minimum squared error between the model results and the path Unfortunately this takes a lot of time and the results are not stellar either. I am looking forward to your input. Thank you for your time.

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

Re: Initialize Add Factor so model solves the target variabl

Postby EViews Gareth » Tue Apr 03, 2012 9:04 am

I believe you want model.control, as specified in the Object Reference.

temp01
Posts: 17
Joined: Tue Apr 03, 2012 3:04 am

Re: Initialize Add Factor so model solves the target variabl

Postby temp01 » Tue Apr 03, 2012 9:14 am

Thank you Gareth. I will look into that and get back to you. Incidentally I have found your replies to other users in this forum very useful on previous occasions as well!

temp01
Posts: 17
Joined: Tue Apr 03, 2012 3:04 am

Re: Initialize Add Factor so model solves the target variabl

Postby temp01 » Tue Apr 03, 2012 9:38 am

OK I tested it and it works great for one variable.

It works as follows for anyone else interested:

say you want to change the variable es to follow a specific path es_path by fiddling with the add factors of gr (gr_a) in your model named (rather imaginatively) model. You do:

model.control gr_a es es_path

and it works.

My problem is that I have say four variables and would like to fix the path of 3 by changing the add factors of a different overlapping but not same set of three variables. When I use the above command either sequentially or on the same line of code the last one to be specified gets the correct path but it ruins the path of the others. So it seems this method only works for one variable at a time.

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

Re: Initialize Add Factor so model solves the target variabl

Postby EViews Gareth » Tue Apr 03, 2012 10:45 am

The built in stuff only works for one variable at a time.

Check out the MControl add-in for multiple stuff. (Although note, we didn't write it, so can't offer support).
http://eviews.com/Addins/addins.shtml

temp01
Posts: 17
Joined: Tue Apr 03, 2012 3:04 am

Re: Initialize Add Factor so model solves the target variabl

Postby temp01 » Wed Apr 04, 2012 1:02 am

Thank you very much for this informaiton Gareth. I will try it today and let you know how it goes.

temp01
Posts: 17
Joined: Tue Apr 03, 2012 3:04 am

Re: Initialize Add Factor so model solves the target variabl

Postby temp01 » Wed Apr 04, 2012 2:16 am

I tried it on a simplistic model and it works as advertised! I made three groups:

g_a is the group with the add factor variables to change
g_var is the group with the variables we want to follow a specific path
g_path is the group with the specific paths we want our variables to follow

The order of the series is the same in all group, I assumed this was necessary. Then the final command model.mcontrol follows the same format as the model.control one. That is first the add-factor group, then the variable group and lastly the path group.

Code: Select all

group g_a gr_a pt_a ie_a group g_var pt ie es group g_path pt_path ie_path es_path model.solveopt(g=12,z=1e-12) model.mcontrol g_a g_var g_path

temp01
Posts: 17
Joined: Tue Apr 03, 2012 3:04 am

Re: Initialize Add Factor so model solves the target variabl

Postby temp01 » Wed Apr 04, 2012 2:22 am

Now it would be interesting to know how this was achieved. i.e. what is the code running behind this add-in? Is the creator in these forums?

temp01
Posts: 17
Joined: Tue Apr 03, 2012 3:04 am

Re: Initialize Add Factor so model solves the target variabl

Postby temp01 » Wed Apr 04, 2012 6:03 am

The pdf documenting this is found in Eviews--> Addins--> docs.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests