Page 1 of 1

Questions about filtered_vars and identification

PostPosted: Thu Oct 23, 2014 3:40 pm
by Econbee
Dear all,

I recently encountered the following two problems during estimation. The related files are attached, which include Question1 and Question2. I am using Dynare Unstable version 2014-10-11. Hopefully I could get some hints from you who have had similar experiences.

1. For Question1, I am actually trying to replicate Lubik and Schorfheide (2004 AER). The model is the simplest three-equation New Keynesian model. Once I finish estimation and trigger identification, I always get the following error message. Note, in Lubik and Schorfheide (2004), there is a correlation between structural shocks to be estimated. I found that when I comment out the line for this correlation in the estimated_params block, the following error disappeared. The only possible reason for the error is that there is no declaration for the parameter of correlation in the parameters block. But this totally follows the manual and user guide for the treatment of the correlation term. When I do estimation instead of identification analysis, there is no error at all. I don't know if there is an internal bug here in the identification package or some other errors in my mod file?

Error using .*
Matrix dimensions must agree.
Error in identification_analysis (line 226)
deltaM = deltaM.*abs(params');
Error in dynare_identification (line 271)
[idehess_point, idemoments_point, idemodel_point, idelre_point, derivatives_info_point, info] = ...
Error in Question1_3obs (line 202)
dynare_identification(options_ident);
Error in dynare (line 185)
evalin('base',fname) ;

2. For Question2, when I finish estimation, I discovered that in the oo_.FilteredVariables, I only have "Mean, Median, Var, deciles, HPDinf, HPDsup". In other cases I have tried for other models, such as Question1 (please comment out the command for identification and then try it), in oo_.FilteredVariables, besides "Mean, Median, Var, deciles, HPDinf, HPDsup", I also get the filtered values for each individual variable. Suppose I have 100 observations, then in the filtered values for each individual variable, I get a vector of size 101*1 with the first value equal to 0. In "Mean, Median, Var, deciles, HPDinf, HPDsup", the filtered values are all vectors of size 100*1. I know the values in "Mean, Median, Var, deciles, HPDinf, HPDsup" should be based on the MCMC results. I am wondering what are the values for each individual variable besides "Mean, Median, Var, deciles, HPDinf, HPDsup"? Are they the filtered variables based on the mean of the posterior? Why don't I get individual filtered variables when I run Question2.mod? The only obvious differences between Question 1 and Question 2 are that (1) I use an external file for steady state and (2) I use mode_file option in Question 2. But I tried not use them and found that the problem still existed. I am wondering if there is a bug here or some errors in my code?

Thanks very much in advance!

Re: Questions about filtered_vars and identification

PostPosted: Tue Oct 28, 2014 4:07 am
by Econbee
Dear Johannes,

I updated my questions and I would appreciate it very much if you could give me some help!

Thank you!

Re: Questions about filtered_vars and identification

PostPosted: Wed Oct 29, 2014 9:48 am
by jpfeifer
1. Identification at the current stage does not support correlations and measurement errors. You would need to circumvent this by using a common shock, see e.g. http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=5135

2. This is a small bug. When you do not specify the smoother command (as in the Question1.mod), Dynare will produce the Bayesian filtered variables as documented in the manual and "ML" filtered variables based on parameters at the posterior mean. This explains why both are present.

Re: Questions about filtered_vars and identification

PostPosted: Wed Oct 29, 2014 2:39 pm
by Econbee
Thank you for the hints, Dear Johannes!

For question 1, the way of using a common shock seems to involve an assumption of negative or positive correlation between the "overall" shock a priori, right? For example, the case in the post you provided assumes negative correlation between the shocks. Similarly, we can have positive correlation by slight change of the definition. I am wondering if I don't want to impose the sign of correlation before estimation, how should I do? Can the trick of common shock take care of this?

For question 2, do you have bug-fixing file for the associated problem?

Thank you again for the reply!

Re: Questions about filtered_vars and identification

PostPosted: Wed Oct 29, 2014 4:25 pm
by jpfeifer
I have to look into 1.
Regarding 2: this is not really a bug that needs to be fixed. You just need to read out the set of filtered variables you want. Dynare offers you both.

Re: Questions about filtered_vars and identification

PostPosted: Thu Oct 30, 2014 12:39 am
by Econbee
Dear Johannes,

I will wait for your response regarding question 1.

For question 2, I meant that if I use smoother option and also want to get "ML" filtered variables based on parameters at the posterior mean, is there a way to do it? I think triggering estimation command twice (one with smoother option to get smoothed shocks and one without smoother option to get "ML" filtered variables based on parameters at the posterior mean) would work. But I am wondering if there is any way to do it in one estimation command but not twice. According to your previous reply, it seems that this is not supported in Dynare. Am I right?

Thanks a lot!!!