Page 1 of 2
Gerali et al Credit and banking
Posted:
Tue Feb 25, 2014 10:37 am
by maa14
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!!
Re: Gerali et al Credit and banking
Posted:
Mon Mar 03, 2014 9:02 am
by federico
Send an email to the authors
Re: Gerali et al Credit and banking
Posted:
Tue Mar 04, 2014 11:32 am
by maa14
Yes, I already did that but there was no answer. In any case thanks for the idea!
Re: Gerali et al Credit and banking
Posted:
Tue Mar 04, 2014 3:07 pm
by federico
Look here , maybe youc could find this post usefull
viewtopic.php?f=1&t=4524
Re: Gerali et al Credit and banking
Posted:
Wed Mar 05, 2014 5:14 pm
by maa14
Thanks that is very useful!!
Re: Gerali et al Credit and banking
Posted:
Fri Mar 14, 2014 9:01 am
by federico
anyway Gerali's model is in the new version of the macro model database
http://www.macromodelbase.com/
Re: Gerali et al Credit and banking
Posted:
Sat Jul 30, 2016 11:34 pm
by Seungcheol Lee
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
Re: Gerali et al Credit and banking
Posted:
Mon Aug 01, 2016 7:46 am
by jpfeifer
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.
Re: Gerali et al Credit and banking
Posted:
Tue Aug 02, 2016 10:51 pm
by Seungcheol Lee
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
Re: Gerali et al Credit and banking
Posted:
Wed Aug 03, 2016 6:57 am
by jpfeifer
Please provide the updated mod-file and the data.
Re: Gerali et al Credit and banking
Posted:
Wed Aug 03, 2016 8:06 am
by federico
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 ?
Re: Gerali et al Credit and banking
Posted:
Wed Aug 03, 2016 10:38 am
by Seungcheol Lee
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
Re: Gerali et al Credit and banking
Posted:
Wed Aug 03, 2016 11:01 am
by jpfeifer
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.
Re: Gerali et al Credit and banking
Posted:
Wed Aug 03, 2016 11:19 am
by federico
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
Re: Gerali et al Credit and banking
Posted:
Wed Aug 03, 2016 2:33 pm
by Seungcheol Lee
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