Uribe & Schmitt-Grohe

Dear all,

I am studying the manuscripts of Uribe & Schmitt-Grohe on this site columbia.edu/~mu2166/book/.
I wrote the correct code for chapter 4, attached in this message. But I would like to estimate the parameters by bayesian inference. I have read the notes of Pfeifer (and I really recommended it), but he suggested put the model in intensive form, first. You can verify on page 17. I would like to know if someone have done this, and, if not, I would like to know how I have to do this intensive form transformation and how the best way to have bayesian inference on my parameters.

PS: I think the best parameters to estimate are db, omega, phi, psi, rho and eta. But I would like more suggestions.

Thank you for all,
Uribe_chapter4_std.mod (2.75 KB)

Hi, I am me again! I am reading Uribe, and at section 4.1.1 - Inducing stationary: external debt-elastic interest rate, he said that if you make the interest rate debt elastic, you can solve the problem of stationarity. However, the doubt goes on: it is necessary transform the model in its intensive form? The user guide of Dynare recommends the same of Pfeifer. I would like to know if, in this case, it is necessary to do that; and, if it is, I would like to know how.

About bayesian inference, my doubts go on, I am going to persist on readings to clarify some points. Thanks for all.

You seem to be confusing things here. The basic small open economy model is non-stationary, but it has nothing to do with growth where writing everything in intensive form removes the unit root. Rather, the model features a unit root because not foreign assets are non-stationary. It is basically the permanent income hypothesis at work. If there is a change in foreign bonds, agents will always consume the annuity out of these additional savings, but they will not consume more than that. Hence, bonds stay at their new level and never return. This is why you need to use one of the tricks available to make the model stationary. See e.g. the reference at [Closing Small Open Economy with Debt elastic interest rate)

Why would the permanent income hypothesis work in a two-country model but not in one country NK model? Is having a bond in foreign country somehow different from domestic bond?

In two country models you could have the same, depending on your model.

But an important difference is that in small open economies the assumption is that the one economy has 0 weight in international capital markets. Its demand for foreign bonds hence does not affect prices. Similarly, if it supplies bonds, they are always demanded at the world interest rate.

You can see this e.g. from the fact that one way to get rid of the non-stationarity is to introduce a debt elastic interest premium.

i see thanks

I am not that familiar with this type of model. There must be a way as these models typically do not feature unit roots. The only thing I can recommend is: search the literature.

Hi Pfeifer,

I would like to understand better what you say. Really, these sound confusing to me, including the description of the problem. I have read the link suggested, but still remain some doubts to me. I’d like other texts to understand, if you have some to recommend.

About the code and bayesian inference, I don’t know if I solve the problem; but I have written a code for this Uribe’s chapter 4 - but, not for the Canadian economy. I did for peruvian economy. This is a problem related to estimated_params_init-block. I am searching and trying to understand what is happening. If someone would like to help, I will be happy. I think I got the priors, so… if someone have any experience in this, it will be cool!

Thanks for the patience, colleagues!
Peruvian.mod (3.8 KB)
peru.xls (37 KB)

Well, at this time, I think my code ran without errors. \o/
Now, I learned with my mistakes, first of all, I included more observable variable than stocks; second, I learned about estimated_params_init… I think I have to reflect about the differences and put better calibrations values to my code.
peru.xls (37 KB)
Peruvian.mod (3.97 KB)

Please take a look at Pfeifer(2013): “A Guide to Specifying Observation Equations for the Estimation of DSGE Models” sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf. You are performing a fundamental mistake by having steady states in nonlinear models depend on estimated parameters and not using either model local variables or a steady_state_model-block. It also seems that you are matching a non-zero mean model variable to a zero mean data variable. Also, how did you detrend your data?

Hmmm, great. I will review your guide about it. Your suggestions sound like true to me, but, let me understanding better your advice:

In this part: "You are performing a fundamental mistake by having steady states in nonlinear models depend on estimated parameters and not using either model local variables or a steady_state_model-block˜.

First, when you said steady states in nonlinear models depend on estimated parameters, you are referring on, for example, h_ss = ((1-alppha)*(alppha/(r_star+deltta))^(alppha/(1-alppha)))^(1/(ommega-1)), right? So, for this particular steady state equation, it is better linearised that?

Second, when you added “not using either model local variables or a steady_state_model-block”, you are suggesting use model local variable, but how I can use that? I think put y_obs is the solution to that…; still, you also suggesting that I use a steady_state_model-block. Do you have some example to attach and looks better to me?

About trends, I use the WDI data, and detrended taking the quadratic trend out on the log-variables. Do you have another suggestion? I only did not attach to the message because the other archive is very big!

Thanks one more time for the patience, Pfeifer.

All the issues you are asking here are answered in Pfeifer(2013): “A Guide to Specifying Observation Equations for the Estimation of DSGE Models” sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf
You can even find the example mod-files on my homepage.

Hi again, Pfeifer,

I am reading your paper. On same time, I am trying to re-write the code. Later, I use a old code (Uribe_chapter4peru.mod) to check if the steady state exists. I concluded yes. The results are:


y 0.778788
c 0.45373
h 0.124885
k 1.71977
d -0.19
i -0.487503
tb -0.00436014
ca 0
a 0
r -2.99573
p 0
lambda 0.134492

However, when I tried to write the code for bayesian inference (standard.mod), I failed. I would like to know how I could fix this.
Thank you,
perua.xls (38 KB)
Uribe_chapter4peru.mod (3.62 KB)
standard.mod (1.44 KB)

Because you are neglecting the parameter dependence for steady state computation. You need to set dbar and beta/rstar in each iteration and compute the steady state conditional on this. Use the steady_state_model-block. See Pfeifer(2013): “A Guide to Specifying Observation Equations for the Estimation of DSGE Models” sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf for more information.

Well, finally, I find something good.
perua.xls (37 KB)
uribe_chapter4_peru_bayes2.mod (2 KB)

Now, I would like to do the chapter 5.
I have problems again with SS.
uribe_chapter5.mod (4.52 KB)

Please first fix the preprocessing errors and set all parameters.


Now I am searching the hayes estimation of some parameters, but I have tried to fix the problems that you had suggested. Please, take a look, and give me a hint why I am having the same problems related to SS. I am looking on the web methods to give good initials, but I am not successful. Do you have some hints to give me? I always try to give consistent values, like y = c + i + tb, or, i = delta*k, but I think this is not enough.

Thanks for help,
perua.xls (37 KB)
uribe_chapter51_peru_bayes.mod (2.74 KB)

Given the low complexity of the model, try computing an analytical steady state.


I was sucessful using this model attached in Matlab R2014a and Dynare 4.3.3; but when I passed the model to my professor and he tried to use in his computer (Matlab R2014b, Dynare 4.3.3), this warning has appeared:

Error using chol
Matrix must be positive definite.

Error in metropolis_hastings_initialization (line 68)
d = chol(vv);

Error in random_walk_metropolis_hastings (line 62)
ix2, ilogpo2, ModelName, MetropolisFolder, fblck, fline, npar, nblck, nruns,
NewFile, MAX_nruns, d ] = …

Error in dynare_estimation_1 (line 782)

Error in dynare_estimation (line 89)

Error in uribe_chapter4_peru_bayes2 (line 216)

Error in dynare (line 180)
evalin(‘base’,fname) ;

I think this is related to Cholesky, but I don’t have idea to solve it. Anyone has a similar problem?

perua.xls (37 KB)
uribe_chapter4_peru_bayes2.mod (2 KB)