Approximated theoretic moments NaN

I got some of variables’ approximated theoretic moments NaN. What does this imply? Can I still trust the result, such as policy functions and simulations ?

You need to find out where the NaN come from. If they result from a unit root, everything should be fine (if the unit root is supposed to be in your model). You can see the eigenvalues using the check-command. If the result from a singularity due to a division by 0, there might be an issue.

Thank you, jpfeifer.

I found the model has both unit eigenvalue and a warning of “Matrix is close to singular”.

The policy functions returned have finite numbers. However, the mean and variance in APROXIMATED THEORETICAL MOMENTS are NaN for some variables. I am confused. How are mean and variance derived? If it is the response to a s.d. of a shock, should mean be a the corresponding result of policy function and nor variance?

A first order solved DSGE model’s solution has the form of a state space system. You can use this system to compute the unconditional mean and variance. See e.g. the book of Hamilton (1994): “Time Series Analysis”. It has nothing to do with IRFs. If your model has a unit root, some variables will be NaN, because a random walk does not have finite first and second moments.

I am confused about the relation between the distribution of shocks I give manually in the shock block, and the distribution of shocks in the state space. I don’t think they are the same, are they?

Because I noticed the difference between the two, if I put the shock in the simulation to get the variance of it from APROXIMATED THEORETICAL MOMENTS. Nonetheless, I get non-zero variance in APROXIMATED THEORETICAL MOMENTS if and only if I specify a shock’s variance in the shock block. So does it mean the state space will skip the shocks that do not appear in the shock block?

If a shock is not specified in the shocks block, its variance is set to 0 (the value it is initialized to). Without the shocks block, how should Dynare know this variance?

Do you mean the variance of a shock in APROXIMATED THEORETICAL MOMENTS should be the same as I specified in the shock block, without some dynare internal imposition? Then it’s weird I didn’t get the consistency. Does it depend on the periods of IRFs I choose? Cheers!

Now I am confused. could it be that you are confusing shock variances and the variance of an exogenous process? Consider


shocks; var epsilon 1; end
In this case, the variance of z will be 1^2/(1-rho^2). This is the number Dynare would display as the theoretical variance for z. It will never display the moments for epsilon.