Dear Dynare Developers,
I have recently encountered some issues when trying to estimate covariances of the structural shocks of my model.
I use Maximum Likelihood to estimate the standard errors of my two structural shocks and the covariance between
the two.
Below, I attach three files in which I make the point with a standard RBC model with (log) government expenditure and (log)
technology shocks. The file rbc_simul simulates the model by imposing the covariances between the shocks through the usage
of the command “var eps_z,eps_g = number”. The file rbc_estimmodel contains the same model but now imposes the covariance
between shocks through
eps_z = eps_zg + u_z;
eps_g = q12*eps_zg + u_g;
where var eps_zg is set to 1 so that q12 captures the covariance between the shocks. This very model is then used in estimation.
The reason why I introduced this common shock is that Dynare, as far as I understood, is only able to estimate correlations but
not covariances and, thus, if one wants to avoid using the deltamethod to get back the correct standard deviations from the
formula which maps correlations to covariances this is the only way to go.
(See also Likelihood only!).
Here are the issues that I would like to discuss with you:

The introduction of a common shock to estimate covariances is not innocuous.
i) While the policy functions of the rbc_simul and of the rbc_estimmodel are the same (except the almost zero coefficients
on the common shocks) the simulated paths for output and other observables are not.
ii) Indeed, output in the rbc_simul model falls in an acceptable range, it has some pathological values in the rbc_estimmodel
(ranging from 5!! to 10) unless the variance of the common shock is set to zero (in which case we would get the case of
uncorrelated structural shocks). 
The only way to keep output in an acceptable range is to use a specification of the covariances of this type
eps_z = sqrt(q12)*eps_zg + u_z;
eps_g = sqrt(q12)*eps_zg + u_g;
but this is clearly unfeasible when your true covariance is negative and still simulated data are different from the ones
in the rbc_simul model. In fact, in the bigger model I use for my paper this specification was the only one which allowed
me to get sensible estimation results (estimated parameters close to the true values, nonpathological mode_check plots,
etc.)
In sum, my fear is that introducing this common shock to estimate variances is not the right way to go because we are not
actually estimating the right model.
Many thanks in advance and best wishes,
Francis
rbc_estim.mod (2.77 KB)
rbc_estimmodel.mod (2.2 KB)
rbc_simul.mod (2.12 KB)