Dear all,
there is a serious issue in both the current snapshot and Dynare 4.2.5 when the covariance matrix of the structural errors is not diagonal. I attached a mod-file showing the issue.
The situation is as follows: The model specifies a correlation between two shocks using
shocks; var e_g; stderr 1; var e_R; stderr 1; corr e_R, e_g = 0.5; end;
The preprocessor then sets M_.Sigma_e to [1 0.5; 0.5 1]. In a next step, I want to estimate the standard errors of e_R and e_g
estimated_params; stderr e_R, inv_gamma_pdf, 0.01, inf; stderr e_g, inv_gamma_pdf, 0.01, inf; end;
The problem is that I wanted to specify a predefined correlation between the two shocks. However, when the estimation updates the standard deviation of the shocks only the diagonal is updated, but not the off-diagonal elements, which stay at 0.5. As a result M_.Sigma_e becomes [0.01^2 0.5; 0.5 0.01^2] when the prior mean is used as initial values for estimation. But given a correlation of 0.5 it should be [0.01^2 0.5*0.01^2; 0.5*0.01^2 0.01^2] The reason is that the preprocessor sees no need for updating the off-diagonal and sets estim_params_.corrx0[]. Hence, in set_all_parameters.m the covariances are not set. This bug is the reason the attached mod-file crashes with a warning that the SS-matrix is not positive definite when you comment out the "corr..."-statement in estimated_params that leads to the crash in identification.
The same problem also occurs if I use "var e_R, e_g = 0.5*1*1;" instead of "corr e_R, e_g=0.5". I am not sure what is the best level to fix this bug as it both involves the estimation routines as the preprocessor.
Best,
Johannes
--
Johannes Pfeifer
Haußerstr. 29
72076 Tübingen
Tel.: +49-(0)7071-6396184
Mobil.: +49-(0)170-6936820
Germany
Thanks Johannes. It is indeed a bit complicated to fix. I will open a ticket and suggest a solution.
Best
Michel
On 05/10/2012 11:28 PM, Johannes Pfeifer wrote:
Dear all,
there is a serious issue in both the current snapshot and Dynare 4.2.5 when the covariance matrix of the structural errors is not diagonal. I attached a mod-file showing the issue.
The situation is as follows: The model specifies a correlation between two shocks using
shocks; var e_g; stderr 1; var e_R; stderr 1; corr e_R, e_g = 0.5; end;
The preprocessor then sets M_.Sigma_e to [1 0.5; 0.5 1]. In a next step, I want to estimate the standard errors of e_R and e_g
estimated_params; stderr e_R, inv_gamma_pdf, 0.01, inf; stderr e_g, inv_gamma_pdf, 0.01, inf; end;
The problem is that I wanted to specify a predefined correlation between the two shocks. However, when the estimation updates the standard deviation of the shocks only the diagonal is updated, but not the off-diagonal elements, which stay at 0.5. As a result M_.Sigma_e becomes [0.01^2 0.5; 0.5 0.01^2] when the prior mean is used as initial values for estimation. But given a correlation of 0.5 it should be [0.01^2 0.5*0.01^2; 0.5*0.01^2 0.01^2] The reason is that the preprocessor sees no need for updating the off-diagonal and sets estim_params_.corrx0[]. Hence, in set_all_parameters.m the covariances are not set. This bug is the reason the attached mod-file crashes with a warning that the SS-matrix is not positive definite when you comment out the "corr..."-statement in estimated_params that leads to the crash in identification.
The same problem also occurs if I use "var e_R, e_g = 0.5*1*1;" instead of "corr e_R, e_g=0.5". I am not sure what is the best level to fix this bug as it both involves the estimation routines as the preprocessor.
Best,
Johannes
--
Johannes Pfeifer
Haußerstr. 29
72076 Tübingen
Tel.: +49-(0)7071-6396184
Mobil.: +49-(0)170-6936820
Germany
Dev mailing list Dev@dynare.org https://www.dynare.org/cgi-bin/mailman/listinfo/dev