Gerali et al Credit and banking

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.

Gerali et al Credit and banking

Postby maa14 » Tue Feb 25, 2014 10:37 am

Hi,

Has anyone worked in the Gerali, Neri, Sessa, Signoretti JMCB 2010 paper "Credit and banking in a DSGE model of the Euro Area"? Any idea from where to get the source code?

Thanks!!
maa14
 
Posts: 10
Joined: Tue Feb 25, 2014 10:31 am

Re: Gerali et al Credit and banking

Postby federico » Mon Mar 03, 2014 9:02 am

Send an email to the authors
federico
 
Posts: 68
Joined: Fri Mar 30, 2012 4:46 pm

Re: Gerali et al Credit and banking

Postby maa14 » Tue Mar 04, 2014 11:32 am

Yes, I already did that but there was no answer. In any case thanks for the idea!
maa14
 
Posts: 10
Joined: Tue Feb 25, 2014 10:31 am

Re: Gerali et al Credit and banking

Postby federico » Tue Mar 04, 2014 3:07 pm

Look here , maybe youc could find this post usefull
viewtopic.php?f=1&t=4524
federico
 
Posts: 68
Joined: Fri Mar 30, 2012 4:46 pm

Re: Gerali et al Credit and banking

Postby maa14 » Wed Mar 05, 2014 5:14 pm

Thanks that is very useful!!
maa14
 
Posts: 10
Joined: Tue Feb 25, 2014 10:31 am

Re: Gerali et al Credit and banking

Postby federico » Fri Mar 14, 2014 9:01 am

anyway Gerali's model is in the new version of the macro model database

http://www.macromodelbase.com/
federico
 
Posts: 68
Joined: Fri Mar 30, 2012 4:46 pm

Re: Gerali et al Credit and banking

Postby Seungcheol Lee » Sat Jul 30, 2016 11:34 pm

Hello.

I'm trying to replicate Gerali et al (2010).

I found the code in the new version of the macro model database and
I'm trying to estimate endogenous variables with data rather than loading median of posterior (dummy way).

However, I encountered the following error message.

"POSTERIOR KERNEL OPTIMIZATION PROBLEM!
(minus) the hessian matrix at the "mode" is not positive definite!
=> posterior variance of the estimated parameters are not positive.
You should try to change the initial values of the parameters using
the estimated_params_init block, or use another optimization routine."

I think it's because of using different data. I used data with period of "20051Q~20161Q" rather than "1998Q1-2009Q1", which is the period of the Gerali et al (2010). Moreover, some data sources may be different.
(I transformed real variables as log deviations from the HP-filter trend and interest rate and inflation rates are expressed in absolute deviations from the sample mean following p.123 of Gerali et al.(2010))

Thus, I guess that I need to change initial values or priors of parameters, but I don't have good idea now.

I'd really appreciate it if anyone can give me advice on this problem.

Thank you in advance.
Seungcheol
Attachments
Gerali_estimation.mod
(25.35 KiB) Downloaded 231 times
dataGerali.m
(5.39 KiB) Downloaded 193 times
Seungcheol Lee
 
Posts: 14
Joined: Mon Jun 29, 2015 10:17 am

Re: Gerali et al Credit and banking

Postby jpfeifer » Mon Aug 01, 2016 7:46 am

You currently cannot use the macro model database files for estimation as their mod-files do not correctly handle parameter dependence. You need to invest a lot of work into getting a functioning file. See Pfeifer(2013): "A Guide to Specifying Observation Equations for the Estimation of DSGE Models" https://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf for details on how to do this.

P.S.: Although Gerali et al do so, you are not supposed to use the HP-filter in the context of estimating DSGE models.
------------
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: Gerali et al Credit and banking

Postby Seungcheol Lee » Tue Aug 02, 2016 10:51 pm

Dear Johannes

Thank you for your helpful advice.

Following your help, I changed my observation equations as following:

dc = 100*(0.0018916 + C - C(-1)); % dc: consumption growth rate in percentage terms, constant: average of consumption growth
dinv = 100*(0.0007868 + I - I(-1)); % dinv: investment growth rate in percentage terms
infobs = 100*(0.0038802 + pie); % infobs: inflation in percentage terms
wages = 100*(0.0057283 + PIW); % wages: real wage growth rate in percentage terms
hp = 100*(-0.0010362 + q_h - q_h(-1)); % hp: house price increasing rate in percentage terms
loansH = 100*(0.00399205 + BH - BH(-1)); %loansH: growth rate of loans to household in percentage terms
loansF = 100*(0.00552665 + BE - BE(-1)); %loansF: growth rate of loans to firm in percentage terms
deposits = 100*(0.00625248 + D - D(-1)); %deposits: growth rate of deposits in percentage terms
interestPol = 100*exp(r_ib); % interestPol: quarterly policy rate in percentage terms
interestH = 100*exp(r_bh); % interestH: quarterly loans rate to households in percentage terms
interestF = 100*exp(r_be); % interstF: quarterly loans rate to firms in percentage terms
interestDep = 100*exp(r_d); % interestDep : quarterly deposit rate in percentage terms

However, I still encountered same error message, so I used mode_compute=6 and I got an estimation result.
( I used same priors and the scales of shocks in Gerali et al.(2010) and the replicate file of macroeconomic model data base)

My further questions are
1) How can I check whether I got a reliable result? If I got close estimated posterior values to Gerali et al.(2010), is it a good sign for right estimation? Can you tell me how to read diagnostic statistics from dynare(e.g. MCMC univariate convergence diagnostics)?
(please refer to the attached diagnostic files)

2) If I want to get impulse responses of some endogenous variables to a shock, is it enough to use median values of estimated parameters and use stoch_simul command such as the case of macroeconomic model database's replicate file?

Thank you again for your help.

Best
Seungcheol
Attachments
fig.zip
(307.42 KiB) Downloaded 152 times
Seungcheol Lee
 
Posts: 14
Joined: Mon Jun 29, 2015 10:17 am

Re: Gerali et al Credit and banking

Postby jpfeifer » Wed Aug 03, 2016 6:57 am

Please provide the updated mod-file and the data.
------------
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: Gerali et al Credit and banking

Postby federico » Wed Aug 03, 2016 8:06 am

A quick reply

a) Gerali's model is calibrated on quarterly data
If the interest rates are expressed in annualized percentage (If you download the data from the ecb website they are expressed in this form), then the observable equations of the interest rates shouldn't be multiplied by 400 ?
federico
 
Posts: 68
Joined: Fri Mar 30, 2012 4:46 pm

Re: Gerali et al Credit and banking

Postby Seungcheol Lee » Wed Aug 03, 2016 10:38 am

Dear all

I upload updated mod file and data file. I didn't upload them because it took about 2 hours to estimate.

I used quarterly interest data (divided by 4) in my data file.

Thank you again!

Best
Seungcheol
Attachments
Gerali_estimation.mod
(25.46 KiB) Downloaded 176 times
dataGerali.m
(5.09 KiB) Downloaded 192 times
Seungcheol Lee
 
Posts: 14
Joined: Mon Jun 29, 2015 10:17 am

Re: Gerali et al Credit and banking

Postby jpfeifer » Wed Aug 03, 2016 11:01 am

You still do not handle parameter dependence. See Remark 4 (Parameter dependence and the use of model-local variables) in my Guide. Things like
Code: Select all
r_k_ss       = -(1-deltak)-m_e_ss*(1-deltak)*piss/beta_e*(1/(1+r_be_ss)-beta_e/piss)+1/beta_e;                       % steady state rental rate of capital

do not belong before the model block.
------------
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: Gerali et al Credit and banking

Postby federico » Wed Aug 03, 2016 11:19 am

I think that the definition of r_k_ss is correct
None of the parameters are estimated in the model block since Gerali et al estimated only the parameters related to the dynamic and not to the steady state

for Seungcheol Lee
I tried to modify the initial values of your estimation. Look at the file in attachment
Attachments
Gerali_estimation.mod
(25.46 KiB) Downloaded 220 times
federico
 
Posts: 68
Joined: Fri Mar 30, 2012 4:46 pm

Re: Gerali et al Credit and banking

Postby Seungcheol Lee » Wed Aug 03, 2016 2:33 pm

Dear Johannes

Thank you always for your quick reply!

Then is it enough to use r_k_ss = 0.0469 (for example) instead of "-(1-deltak)-m_e_ss*(1-deltak)*piss/beta_e*(1/(1+r_be_ss)-beta_e/piss)+1/beta_e"? (I mean eliminating all other parameter dependence and use exact numerical values)

I had thought that using parameter dependence isn't problematic because all elements (deltak, m_e_ss, piss, beta_e, and r_be_ss in calculating r_k_ss) are not estimated
but exactly specified (in case of deltak, piss, beta_e) in the params-statement.

I'd also appreciate it if you can tell me other problems in my mod file.

Best
Seungcheol
Seungcheol Lee
 
Posts: 14
Joined: Mon Jun 29, 2015 10:17 am

Next

Return to Dynare contributions and examples

Who is online

Users browsing this forum: No registered users and 3 guests