Page 1 of 1
Setting minimum while solving multiple equations.
Posted: Thu Apr 12, 2012 4:15 pm
by smith007
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.
Setting minimum while solving multiple equations.
Posted: Thu Apr 12, 2012 6:33 pm
by EViews Gareth
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?
Re: Setting minimum while solving multiple equations.
Posted: Fri Apr 13, 2012 10:43 am
by smith007
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.
Re: Setting minimum while solving multiple equations.
Posted: Fri Apr 13, 2012 2:13 pm
by EViews Chris
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.
Re: Setting minimum while solving multiple equations.
Posted: Fri Apr 13, 2012 5:19 pm
by smith007
I will try to express things in change rates.
Thank you both for your quick replies.
Re: Setting minimum while solving multiple equations.
Posted: Sat May 19, 2012 12:46 am
by jlbrillet
You might also use :
model1.append a1 = a_0(-1) - b*c
model1.append a = a1*(a1>=0)
Jean Louis Brillet.
Re: Setting minimum while solving multiple equations.
Posted: Tue Oct 29, 2013 6:24 am
by Karl1
I tried the latest suggestion, but it does not work so well.
The new variable is not ecsactly equall to zero when the original variable is negative. When the original variabel has the value -0.9, the new variable has the value 1.0. In my model this is interst rates, so the difference is large. In addition, when the original variabel turns positive again after a period with negative values, there is a big difference between the new and original variabel. They should have been equall. Old variable value is 0.4 and the new is 1.6.
Does anybody know how to fix this, so that the new variarble equalls the old exactly when the old is positive, and equalls zero exactly when the old is negative?
Re: Setting minimum while solving multiple equations.
Posted: Tue Nov 19, 2013 6:23 am
by Karl1
Guess nobody knows how to fix this.
Does anybody know why this happends? Why isn't the values identical when the original value is positive, and why is the new value not equall to zero when the original value is negative?
Re: Setting minimum while solving multiple equations.
Posted: Mon Jan 20, 2014 10:36 pm
by Karl1
Answer to my own question:
It works when deterministic simulations is used. Did not work with stochastic simulations.