estimation of Error Variance-Covariance matrix
Posted:
Tue May 16, 2017 11:29 pm
by onthetopo
Hi,
I have a simple two-country model that reads four data series, Consumption and Dividend of Two Countries.
I have four shocks and want to estimate the parameters in the shock Variance-Covariance matrix (correlation, and variance). It seems the best way to learn is to learn from the simplest example possible.
Is there a minimal example that would allow me to achieve this, through any one of, or preferrably I want to see both, by utilizing:
1.Particle Filter, applied on RBC.mod
2.SMM, applied on RBC.mod
Per the standard Dynare example mod file at
http://www.dynare.org/documentation-and-support/examples/rbc.zip, I apolgoize if RBC.mod is inappropiate and there are better minimal examples out there that deals with estimation as well.
Thank you.
Re: estimation of Error Variance-Covariance matrix
Posted:
Thu May 18, 2017 11:06 am
by jpfeifer
1. What do you mean? All you need to do is specify the variances and covariances as estimated parameters. E.g. as in
https://github.com/DynareTeam/dynare/blob/master/tests/TeX/fs2000_corr_ME.mod:
- Code: Select all
varexo e_a e_m;
estimated_params;
stderr e_a, inv_gamma_pdf, 0.035449, inf;
stderr e_m, inv_gamma_pdf, 0.008862, inf;
corr e_m, e_a, normal_pdf, 0, 0.2;
end;
2. SMM is cirrently not supported by Dynare. You can do that manually (e.g. shown in the replication codes to Born/Pfeifer (2014)). But doing this is quite involved and SMM is usually not well-suited for estimating covariance matrices due to weak identification. Full-information methods typically work better.
Re: estimation of Error Variance-Covariance matrix
Posted:
Sat May 20, 2017 7:18 pm
by onthetopo
Thank you sir.
1.By full information model: you mean MLE?
2.The FS2000 example seems to be Bayesian based, as the cited paper indicates, based on loss functions.
are deprecated in current versions of dynare, though they existed in older versions of dynare
Re: estimation of Error Variance-Covariance matrix
Posted:
Mon May 22, 2017 5:44 pm
by jpfeifer
1. Anything that is likelihood based, i.e. either MLE or Bayesian estimation
2. Yes, fs2000.mod is Bayesian estimation, but there are also version of the file using MLE. The loss function only comes into play for evaluating the model fit, not for estimation itself.
3. I don't understand your last sentence.
Re: estimation of Error Variance-Covariance matrix
Posted:
Mon May 22, 2017 5:47 pm
by onthetopo
Sorry, in the last sentence, I was going to say that, in the example mod you gave me:
contemporaneous_correlation
conditional_variance_decomposition=[1 2 4]
smoothed_state_uncertainty
seem to be all deprecated in current version of dynare
Re: estimation of Error Variance-Covariance matrix
Posted:
Mon May 22, 2017 6:05 pm
by jpfeifer
No, these are new options that will be available in Dynare 4.5 (hopefully next month). At the current stage, you would need the unstable version:
http://www.dynare.org/download/dynare-unstable/
Re: estimation of Error Variance-Covariance matrix
Posted:
Wed May 31, 2017 3:05 am
by onthetopo
Thank you so much for your help. One question that looks strange is that, in
https://github.com/DynareTeam/dynare/bl ... orr_ME.mod:
The line
corr e_m, e_a, normal_pdf, 0, 0.2;only appears in the estimated_params block.
However, in the shocks block we have instead:
shocks;
var e_a; stderr 0.014;
var e_m; stderr 0.005;
corr gy_obs,gp_obs = 0.5;
end;Two questions,
1.In the shocks block, we have
var e_a; stderr 0.014; does 0.014 have to be the mode of the prior?
2. Why is that an initialized value
corr e_m, e_a, 0 is not present in the shocks block? but
corr gy_obs,gp_obs = 0.5; is present in the shocks block.
Re: estimation of Error Variance-Covariance matrix
Posted:
Wed May 31, 2017 3:32 pm
by jpfeifer
Those are two different things. The
- Code: Select all
shocks
block calibrates the model. These values are kept at the fixed value unless you estimate them in the
- Code: Select all
estimated_params block
The test mod-file is unusual in that it calibrates some variances and estimates some. That is because we want to test both features.
Re: estimation of Error Variance-Covariance matrix
Posted:
Thu Jun 01, 2017 2:31 am
by onthetopo
Thanks.
1.When both are declared in the shocks block and in the estimated_params block, am I right to think that what dynare uses to calculate the stochastic steady states and moments in stoch_simul(), is 0.014 as in the shocks block, but in estimation() when initializing a prior, 0.035449 is used, as in the estimated_params block?
shocks;
var e_a; stderr 0.014;
var e_m; stderr 0.005;
corr gy_obs,gp_obs = 0.5;
end;
estimated_params;
alp, 0.356;
gam, 0.0085;
del, 0.01;
stderr e_a, 0.035449;
stderr e_m, 0.008862;
corr e_m, e_a, 0;
stderr gp_obs, 1;
stderr gy_obs, 1;
corr gp_obs, gy_obs,0;
end;
2. Suppose I want to write up a paper with estimation, how do I describe the estimation procedure in the paper? Any existing paper that uses dynare to estimate parameters in general, and stderr of errors in particular, which I can follow in terms of methodology description? I am using mode_compute=6. Schorfheide 2000 provides a technical description in general.
Re: estimation of Error Variance-Covariance matrix
Posted:
Thu Jun 01, 2017 4:17 pm
by jpfeifer
1. Yes, that is correct. The shocks-block preceeding the stoch_simul command provides the values for the IRFs etc. computed by stoch_simul while the value in the estimated_params-block is the starting value for estimation.
2. The standard reference for what is going on is An/Schorfheide (2006). Papers that use Dynare for estimation are Smets/Wouters (2007) or e.g. my own work Born/Peter/Pfeifer (2013).