defining a range for the values a variable can take

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

defining a range for the values a variable can take

Postby lfl » Thu Dec 02, 2010 10:51 pm

Hi,

I'm simulating a New Keynesian model with search frictions. The total labor force in the model is normalized to 1, and consists out of the sum of the employed and the ones who remain unemployed after matching took place.

The problem is the following. Theoretically at any point in time the number of unemployed as well as the number of employed cannot exceed 1 ( as this would imply that more people are employed or unemployed than the total labor force).However, when I look at the simulated results I find out that in several cases employment or unemployment exceeds the range [0,1}.

My question is if there is a way to define the range of values a variable can take, or do these results simply imply that there is a mistake in the code?

Thanks a lot for your help!

best,

L.
lfl
 
Posts: 2
Joined: Sun Nov 28, 2010 6:03 pm

Re: defining a range for the values a variable can take

Postby cfp » Sun Dec 05, 2010 9:31 pm

Suppose u is your unemployment rate in your data file at the moment.
Remove u from your list of endogenous variables, and add a new variable uf. Then add the following line to the start of your model block:

Code: Select all
#u = 1 / ( 1 + exp( - uf ) );


Run your simulations and you'll get an irf for uf. This can then be transformed into an irf for u by adding the steadystate value of uf, then using the equation above. By construction it will remain in the unit interval.

Tom
cfp
 
Posts: 60
Joined: Mon Mar 15, 2010 9:18 pm

Re: defining a range for the values a variable can take

Postby SébastienVillemot » Tue Jan 11, 2011 10:15 am

In a stochastic setup, there is no real way of constraining the variables within an interval.

The point is that the solution provided by Dynare is an aprroximation of the solution which is only valid locally around the steady state. Hence in the domain of validity of the solution, the constraint is by construction satisfied.

When you make simulations with big shocks you can end up not verifying the constraint (and this can happen even with the solution proposed by cfp).

This means that you have to shrink the variance of your shocks, so that the local approximation remains a good approximation.
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 8 guests