model control

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

Moderators: EViews Gareth, EViews Moderator

Katjes
Posts: 55
Joined: Thu Oct 02, 2008 5:46 am

model control

Postby Katjes » Tue Dec 06, 2011 2:37 am

Using EViews6 I'm trying to solve a model, with given values for the short-run period.
However, if I only control for one variable it works, but if I add more control variables I just applies to the last control variable.
I tried to simply my problem to the following example, just run it and you see, that cs_0=vsc in the period 2011.4-2013.4.
However if you use more than one variable (i.e. for %var cs i ) than only i_0=vi but no longer cs_0=vsc.
Have you any ideas how I can solve the problem?

(The same problem applies when using Eviews 7.2)

Code: Select all

wfcreate(wf=q, page=myproject) q 1970 2020

smpl 1970.1 2011.3

'Series
genr cs=@nrnd
 genr i=@nrnd
 genr y=@nrnd
 genr g=@nrnd

'Model Specification
model macro
macro.append cs = 10+0.8*y(-1)
macro.append i = 0.7*(y(-1)-y(-2))
macro.append g = 0.7*(y(-1))
macro.append y = cs+i+g

macro.addassign(v) @all 'assigns a variable shift to all equations in the model.
macro.addinit(v=z) @all

'Target Variable
smpl 2011.4 2013.4
genr vcs=1
 genr vi=1

for %var cs 'i  ' does not work  with many control variables
macro.control  {%var}_a  {%var} v{%var}

next '%var

smpl 2011.4 2020
macro.solve

smpl 2011.1 2020.4
group gr cs vcs cs_0 i vi i_0
show gr

Katjes
Posts: 55
Joined: Thu Oct 02, 2008 5:46 am

Re: model control

Postby Katjes » Tue Dec 06, 2011 9:03 am

I just have seen that there is an add-in available called mcontrol, with allows to define the groups of elements. So I built goups

Code: Select all

group var_a  cs_a i_a
group var cs i
group vvar vcs vi
macro.mcontrol  var_a  var vvar


However, it gives an error that the Hessian matrix is singular. Any suggestion how to solve?

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

Re: model control

Postby EViews Gareth » Tue Dec 06, 2011 9:36 am

I believe that EViews only lets you control for one variable, which is why you were seeing your original behaviour, and why that add-in was written. Unfortunately the only way to receive help with that add-in is from the authors (who are not part of the EViews team). You could try re-posting your question in the corresponding add-in forum, or messaging the authors.
Follow us on Twitter @IHSEViews

fbrayton
Posts: 21
Joined: Wed Nov 05, 2008 11:09 am

Re: model control

Postby fbrayton » Wed Dec 07, 2011 3:18 pm

Hi:

I believe the example will work if you modify your program so that all of the model's endogenous variables have data for the full interval that you run the mcontrol addin. (I don't think it makes any difference what the values are.) You could just change your first smpl command so that it extends to 2013.4. This data requirement seems unnecessary in principle and thus appears to be a bug in the design of the addin that I should perhaps fix.

Another point: The efficiency of mcontrol usually is improved by computing solution values to quite a few significant digits. The addin runs a set of perturbation simulations to measure the derivatives of the target variables wrt the control variables, and the perturbation factor is generally quite small. You may find it useful to include the following command in your program -- macro.solveopt(g=12,z=1e-12) -- to ensure that 12 significant digits are always being retained.

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

Re: model control

Postby temp01 » Thu Apr 05, 2012 1:49 am

I get the same error, the Hessian is singular at iteration 1. It further says it is possible that this is caused by a control variable in one or more periods having no effect on any target variable. I tried adding numbers to the future positions of the endogenous variables but still get the same error. Any help would be appreciated.

fbrayton
Posts: 21
Joined: Wed Nov 05, 2008 11:09 am

Re: model control

Postby fbrayton » Fri Apr 06, 2012 6:00 am

Hi:

I'll take a look if you post your program and workfile.


Return to “Models”

Who is online

Users browsing this forum: No registered users and 1 guest