Setting minimum while solving multiple equations.

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

Moderators: EViews Moderator, EViews Gareth, EViews Chris

Setting minimum while solving multiple equations.

Postby smith007 on Thu Apr 12, 2012 4:15 pm

Hello,
This is my first time programming Eviews. I am using version 7. I searched through the forum but could not find this solution.

I have a system of 15 equations that I have added with the .append command. What I would like to do is somehow set a minimum value for an endogenous variable while the system is solving. Example.

model1.append a = a_0(-1) - b*c

What I would like to happend is that if the value of a drops below zero then it would just return zero until it once again starts to get positive values. Is there any way to do this?

Thank you.
smith007
 
Posts: 3
Joined: Thu Apr 12, 2012 4:07 pm

Setting minimum while solving multiple equations.

Postby EViews Gareth on Thu Apr 12, 2012 6:33 pm

Your notation/description is a little confusing.

The text makes me believe you're using a system object. The formula your wrote makes me believe you're using a model object.

Perhaps you could expand a bit?
Follow us on Twitter @IHSEViews
EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
 
Posts: 5785
Joined: Tue Sep 16, 2008 5:38 pm

Re: Setting minimum while solving multiple equations.

Postby smith007 on Fri Apr 13, 2012 10:43 am

I am not 100 familiar with the terminology but I think I am using a model object. I created a new model using model command

like this:

model model1
model1.append a = a_0(-1) - b*c

I use this method to enter a number of equations and i also give initial values to my parameters . Normally it would all solve to a steady state. I create a new scenario that would apply a shock to the system something like

model.scenario baseline
smpl 1950 @last

smpl 1960 @last
some paramater = new value
smpl @all

model1.solve

I then have it draw all the shock responses in graphs. What I would like to do is to somehow set a minimum value for one of the varaiables that is responding to the shock. In particular I have an endogenous interest rate being determined by the system and I would like it to have a minimum value of 0.
smith007
 
Posts: 3
Joined: Thu Apr 12, 2012 4:07 pm

Re: Setting minimum while solving multiple equations.

Postby EViews Chris on Fri Apr 13, 2012 2:13 pm

One way to do this is to use equations whose functional form makes it impossible to end up with a value that make no economic sense (although I think T-bill rates did briefly go negative in late 2008...).

So instead of a linear function like:

y = c(1)*x + z

You might use a log-linear function like:

log(y) = c(1)*log(x) + z

The latter equation generates positive values for y for all values of x and z.

You could also try repalcing the single equation with two equations like this:

y_raw = c(1)*x + z
y = @recode(y_raw>=0, y_raw, 0)

so that y is forced to be non-negative.

This may cause some problems with finding a solution though because the EViews model solution algorithms assume that the model has equations with continuous derivatives and the @recode function makes the derivatives discontinuous. You can certainly give it a try though.
EViews Chris
EViews Developer
 
Posts: 125
Joined: Wed Sep 17, 2008 10:39 am

Re: Setting minimum while solving multiple equations.

Postby smith007 on Fri Apr 13, 2012 5:19 pm

I will try to express things in change rates.

Thank you both for your quick replies.
smith007
 
Posts: 3
Joined: Thu Apr 12, 2012 4:07 pm

Re: Setting minimum while solving multiple equations.

Postby jlbrillet on Sat May 19, 2012 12:46 am

You might also use :

model1.append a1 = a_0(-1) - b*c
model1.append a = a1*(a1>=0)

Jean Louis Brillet.
jlbrillet
 
Posts: 30
Joined: Mon Feb 16, 2009 6:03 am


Return to Models

Who is online

Users browsing this forum: No registered users and 1 guest