Bayesian estimation - data/measurement equation problem

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Bayesian estimation - data/measurement equation problem

Postby jakub » Tue Oct 15, 2013 9:55 pm

Hello,

I am having problem estimating the Gertler - Karadi (2011) model of uncoventional monetary policy.

I have read (hopefully) all threads on this forum regarding this issue, however, I am still struggling to produce decent results.
From the things I tried - at first, I followed approach of SW, defining measurement equations in the form of
Code: Select all
y_obs = y - y(-1)
trying to include constant term in the form of (estimated) measurement error or trend growth rate. Dataset used in the estimation was log differenced. Neither of this worked, all ending with dynare and mode_compute=4 unable to find mode and well known error
Code: Select all
Error using chol
Matrix must be positive definite.

I have also tried to pass the data through the HP filter to get rid of trend (then removing measurement equations and having observables defined only as y, c etc.) - this didn't work as well.
The only method that worked and with which dynare was able to find mode and subsequently run Metropolis-Hastings was to have the data log differenced and have measurement equations including measurement error
Code: Select all
y_obs = y - y(-1) + me_y
which was defined in the shocks section as
Code: Select all
var me_y; stderr 1;
This produced results, however, the historical shock decomposition of observable variables was useless, since the only thing I saw on the graphs was the whole area explained by measurement error...
I also tried to multiply the observable data by the factor of 100 as in SW, but reading their code I was not so sure how should I update the rest of my .mod file, mainly the steady state values to get this working...
Same goes with values for prior distributions, I tried many many different values.

I attached the .mod file (available also at macromodels database) as well as the data, with the version including measurement equations, without me errors defined. Data are log differenced, taken from FRED database and include real GDP growth (levels), consumption, net investment, bank net worth and inflation (calculated as log differenced CPI)

I would be thankful for any help
Attachments
data_new.xls
Data
(49 KiB) Downloaded 126 times
model_est.mod
Model file
(4.5 KiB) Downloaded 205 times
Last edited by jakub on Wed Oct 16, 2013 10:43 am, edited 1 time in total.
jakub
 
Posts: 2
Joined: Tue Oct 15, 2013 9:27 pm

Re: Bayesian estimation - data/measurement equation problem

Postby reubenpjacob » Wed Oct 16, 2013 2:34 am

Try to find a better mode of the posterior before you start the MCMC. The problem, I think is with the estimate of the Hessian at the mode. Try mode_compute= 7 or 8 or a combination. A reasonably well conditioned Hessian will solve most of your problems.
reubenpjacob
 
Posts: 133
Joined: Fri Oct 06, 2006 3:23 pm
Location: Reserve Bank of New Zealand

Re: Bayesian estimation - data/measurement equation problem

Postby jakub » Wed Oct 16, 2013 10:38 am

I was thinking about trying different mode_compute, but isn't the problem more related to reshaping the data or defining correctly measurement equations? Why is that with fixed measurement errors to 1 the estimation runs even with mode_compute=4?
jakub
 
Posts: 2
Joined: Tue Oct 15, 2013 9:27 pm

Re: Bayesian estimation - data/measurement equation problem

Postby jpfeifer » Tue Oct 22, 2013 9:32 am

Because then the model plays almost no role in explaining the observables. The measurement error does. Any deficiencies of the model are then glossed over.
Please provide explicit starting values for your parameters as a first step to improvement (instead of starting at the prior mean)
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Bayesian estimation - data/measurement equation problem

Postby alexandrudin » Sat May 24, 2014 8:52 pm

I have the following problem with a GK replication:

Error using dynare_estimation_init (line 277)
Estimation: the 'estimated_params' block is mandatory (unless you are running a
smoother)

Error in dynare_estimation_1 (line 81)
[dataset_,xparam1, hh, M_, options_, oo_, estim_params_,bayestopt_] =
dynare_estimation_init(var_list_, dname, [], M_, options_, oo_, estim_params_,
bayestopt_);

Error in dynare_estimation (line 89)
dynare_estimation_1(var_list,dname);

Error in aaa (line 434)
dynare_estimation(var_list_);

Error in dynare (line 180)
evalin('base',fname) ;
Attachments
aaa.mod
(6.16 KiB) Downloaded 65 times
alexandrudin
 
Posts: 1
Joined: Fri May 23, 2014 7:29 am

Re: Bayesian estimation - data/measurement equation problem

Postby rudy » Sat May 24, 2014 10:13 pm

Hi,

I'm absolutely not an expert, neither in dynare nor bayesian estimation, but you did not declare priors.
That is what dynare tells you: the 'estimated_params' block is mandatory

Hope this can help a little.

rudy
rudy
 
Posts: 10
Joined: Sat May 24, 2014 4:53 pm

Re: Bayesian estimation - data/measurement equation problem

Postby rudy » Sat May 24, 2014 10:19 pm

Also, it seems that you have more observables than shock and, if I am not mistaken, this will lead to stochastic singularity: you must have at least as much shocks as observables.

Rudy
rudy
 
Posts: 10
Joined: Sat May 24, 2014 4:53 pm


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 5 guests