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.
Moderators: EViews Gareth, EViews Moderator
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Setting minimum while solving multiple equations.
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?
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
Re: Setting minimum while solving multiple equations.
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.
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.
-
- EViews Developer
- Posts: 161
- Joined: Wed Sep 17, 2008 10:39 am
Re: Setting minimum while solving multiple equations.
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.
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.
I will try to express things in change rates.
Thank you both for your quick replies.
Thank you both for your quick replies.
Re: Setting minimum while solving multiple equations.
You might also use :
model1.append a1 = a_0(-1) - b*c
model1.append a = a1*(a1>=0)
Jean Louis Brillet.
model1.append a1 = a_0(-1) - b*c
model1.append a = a1*(a1>=0)
Jean Louis Brillet.
Re: Setting minimum while solving multiple equations.
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?
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.
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?
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.
Answer to my own question:
It works when deterministic simulations is used. Did not work with stochastic simulations.
It works when deterministic simulations is used. Did not work with stochastic simulations.
Who is online
Users browsing this forum: No registered users and 24 guests