Calculating variable variance

Hi everybody,

I have a conceptual issue regarding calculating the variance of endogenous variables. I understand that I can retrieve the variance-covariance information from oo_.var after running the stochastic simulation. Suppose I define a variance explicitly in the mod file, and run a second-order simulation. What I discovered is that the mean of the explicitly defined variance is different compared to the one calculated in oo_.var.

As a demonstration, I modified the example1 file provided in dyanre by adding an explicitly defined variance on consumption (varc). After running a second-order simulation, the variance of consumption shown in oo_.var is 0.0028, while the explicitly defined variance varc shows a mean close to 0. I am confused about what causes the difference between the two. Thanks, everybody, for the attention.

Best regards,

Tian Xia

example1.mod (1.6 KB)

There is a difference whether you compute a nonlinear function (variance) based on an approximation of the model and whether you approximate the nonlinear function within the model. The function

varc=(c(+1)-ec)^2;

will be approximated at the deterministic steady state, where its derivative is 0. It’s the same reason why you cannot solve portfolio choice models using perturbation.