I’m trying to simulate a model with multiple types of agents and am having trouble. I’ve reduced it to a simple deterministic ramsey model with two agents differentiated by their distaste for labor. Dynare is able to compute steady states for any sets of parameters, but when the agents are different, simulations don’t work. That is, I’ll simulate changing the utility function of one of the agents and capital for the two agents go off to +/- infinity. Does anybody have any suggestions? My code is below.
as it is, steady can’t compute the terminal equilibrium specified by ENDVAL. Most likely because the guess value for the endogenous variables are too far from the solution. This could be fixed by trial an error, starting by solving steady state problems closer to the one specified in INITVAL (set a2 closer to 0.5) and working from there
more serious the model contains a unit root and can’t be solved even when the terminal steady state is the same as the initial one (for a2 constant). This has to do with the structure of the model itself.
When I copy the code that I posted and take out the comments, it runs fine. Dynare calculates the steady state for both the starting and ending values and runs a simulation (the simulation just has the problem I described before). I’m not sure why there would be a unit root – Dynare isn’t telling me there is one. this is simply the ramsey model with two agents; there shouldn’t be a unit root anywhere.
What makes you say there’s a unit root?
If it helps, these are approximately the steady state values for the endpoints:
a1=2;
a2=2;
c1=.13;
k1=.06;
l1=.33;
c2=.13;
k2=.06;
l2=.33;
I’m not getting a warning about the maximum number of iterations. It just runs straight through, saying all 5 iterations of the simulation ran and convergency was obtained.
As to the steady state, what’s the intuition behind why this shouldn’t work. Why shouldn’t I be able to write down a model with multiple agents who behave exactly as in the ramsey framework? The fact that some of the equations are redundant shouldn’t matter since the solution involves all the agents behaving identically, no?
As to the singularity problem, I’m not sure I see how your example corresponds to my model. You write
xy = 1
yx = 1
I, on the other hand, would interpret the two intertemporal euler equations – c1(+1)/c1=c2(+1)/c2=1 as being similar to
ab=1
cd=1
In that case There’s no problem. The intuition here is that there is no reason we shouldn’t be able to solve a representative agent model with an arbitrarily large number of agents. They will all have identical first order conditions defining the equilibria, and they will all displsy identical behavior. test1.mod (940 Bytes)
As I think about it a bit more, it seems like Dynare is solving for an equilibrium path – i.e. all the constraints are satisfied – but the no ponzi game and transversality conditions are being violated.
In the NeoClassical growth model, equilibrium capital stock doesn’t depends on preferences, so the respective capital holdings of agents 1 and 2 are undetermined at the steady state.
In Dynare the transversality condition is imposed in the following manners:
for deterministic models (simul) by setting the terminal steady state
for stochastic models (stoch_simul) by selecting the unique stable trajectory in the linear rational expectation problem (see Blanchard and Kahn)
Ah, you’re right. Sorry for being so dense. And thanks again for being so quick with your replies. Creating Dynare was an unbelievable gift in itself. Running this board is above and beyond the call of duty.
In thinking about it and talking to some other people, I’m actually no longer sure you’re right. Have you tried running my code? Dynare runs it without reporting any errors. There should be no reason you can’t have a representative agent model with two identical agents – the total capital stock is pinned down only by preferences, but the budget constraints and steady state consumption levels determine the amount of capital held by each agent.