Log and level in dynare

Hi there, I have a puzzling question that annoys me much and I wonder if you could help.

In my dynare code, if I write the mod file in LEVEL, with a relatively large shock, some of my variables simulated are negative. This negative value is not wished. So I want to avoid this.

One way is to decrease the shock volatility.

However, if the shock volatility remains as before, but I write my mod file in terms of EXP (i.e do log-transformation), then is it by construction my variables are positive?? This is my Q1. Am I allowed to do this and I can really get what i want (non-negative variable values in simulation)?

If not, what is the difference between this LEVEL form and log form in dynare simulation?

If so, is this a way to impose non-negative constraint in my dynare mod file?



In a nutshell

Hi Prof.,

Thanks for your prompt reply. Yes I understand the conclusion you were trying to convey that we cannot simply replace level (say X) with exp(log(X)) in dynare mod file to impose the non-negative constraints.

However, I am curious why so. As it seems that all my variables defined this way do has the property of not being negative.

Many thanks.

As my reply said: it is about the linear model solution. Whether you use the level or the log-level in the nonlinear model, you will be approximating it with a linear function at first order. Linear functions, by construction, are unbounded. That is an approximation error you will have to live with.

1 Like