Negative hours worked after temporary shock


I took the traditional deterministic neoclassical growth model and extended it by adding a female agent. So now, in the representative household, there is a male and a female supplying hours. I called the time endowment of each agent as thetam and thetaf. The idea of the exercise is to temporarily reduce the time endowment of females and simulate the model. However, for some values of thetaf, the female agent starts to supply negative hours.

How can I constraint the hours to be positive?


simulation2.mod (4.6 KB)


I found a way to solve the issue, but I’m not sure if it’s the best one. I was reading the manual and realized that Dynare works with the max() function. Therefore, I updated the hour’s equation by adding the maximum between its value and zero. The model is running smoothly. The file is attached.

However, I’m bugged about something. When I calculate the hours FOC and set it to zero, it means that I’m looking for an interior solution, i.e., a solution different from zero. But when using the above approach, the hour’s result during the temporary shock is exactly equal to zero. It seems that there is something theoretical not adding up. That’s why I suspect that should be a better way of solving the issue of negative hours.

Any ideas?


simulation3.mod (4.6 KB)

sometimes you can get negative hours (that is, more leisure) due to the income-substitution trade off between consumption and leisure. Whether labor falls or rise after the shock depends on which effect is stronger…

Sure. I’m using additive log utility:

u(c, lm, lf) = log(c) + lambdam*sm*log(thetam - lm) + lambdaf*sf*log(thetaf - lf),

where sm and sf are the shares of males and females workers, lambdam and lambdaf the weights on leisure, and thetam and thetaf the time endowments. I’m shocking the female time endowment.

But we cannot have negative hours, right? So what is the best way to implement this constraint?


  1. Did you get a message that the perfect foresight simulation converged?
  2. Usually, the type of Kuhn-Tucker problem with a non-negativity constrained requires setting it up as a mixed complementarity problem (mcp-tag)
  1. I got the following message with both codes: “Perfect foresight solution found.”

  2. Can you point me some references and/or examples on this approach?


  1. Why don’t people ever use this mixed complementarity approach since hours must never be negative? Shouldn’t it be the standard when modeling hours?


  1. See
  2. As long as you get an interior solution, there is no point in defining where the corner of the problem is.