Johannes Pfeifer's Dynare Code of GPU (2010)

Hi everyone,

I am using the Dynare code for the paper of GPU (2010)

Blockquote García-Cicco, Javier and Pancrazi, Roberto and Uribe, Martín (2010): “Real Business Cycles in Emerging Countries”, American Economic Review, 100(5), pp. 2510-2531.

This code is provided by Prof. Pfeifer at

Blockquote https://github.com/JohannesPfeifer/DSGE_mod/blob/master/GarciaCicco_et_al_2010/GarciaCicco_et_al_2010.mod

I have two confusing issues about this code. Can some one explain it for me

Firstly, in regard to the definition of trade balance

Blockquote line 165-166 such as
%4. Trade balance
log(tb)= d - d(+1)*g/r; (1)

As The appendix of the original paper, the section 2:" Equilibrium Conditions in Stationary Form", the equation for Resource constraint, on page 2 appendix.pdf (99.1 KB) , the trade balance is tb= d - d(+1)*g/(1+r); this is gross interest rate in the denominator but in Pfeifer’s dynare code indicates that only interest rate in the denominator as the expression (1) above. What is difference here?

Secondly, in regard to the log form of trade balance, trade balance can be either positive or negative, but why in the dynare code calling the log form of trade balance,

Blockquote see the line 165-166
%4. Trade balance
log(tb)= d - d(+1)*g/r;
and the line 183 -184 (measurement of trade balance to gdp)
%10. Definition trade-balance to output ratio
log(tb_y) = log(tb)/y;

Thirdly, in regard to my computation for observed trade balance as in Prof. Pfeifer’declare as

Blockquote
log(tb_y)
in the line the line 183 -184 (measurement of trade balance to gdp)
%10. Definition trade-balance to output ratio
log(tb_y) = log(tb)/y;

since trade balance is either positive or negative, I do not compute its log form. In stead, the trade balance per capita is the level difference between exports and import (subtracting the exports per cap from the import per cap. These two series are measured in the constant 2010 USD term). Next step, the trade balance to GDP is computed as dividing the trade balance by the real gpd per cap. This step makes me confusing such as whether trade balance to output should be computed as dividing the trade balance by the trend of output as mentioned by Uribe and Schmit-grohe on their slide page number 10 at

Blockquote http://www.columbia.edu/~mu2166/book/empirics/slides_empirics.pdf

then take the cyclical component ( the percent deviation from the quadratic trend) as the observed variable of trade balance to GDP

or trade balance to gdp is just computed as dividing trade balance by gdp (in level) but not taking the cyclical component

In short, how to compute the observed variable of trade balance to GDP in correspond to its theoretical counterpart in the model?

Thank you so much indeed

Best wishes

I generally followed their replication files.

  1. In the paper they use r_t to denote the net interest rate. In the files, r denotes the gross interest rate 1+r_t. You can also see this in the Euler equation.
  2. We want percentage deviations of the trade balance from its steady state. It is not a problem that tb can be negative (investment can also be negative). What you need is for the steady state to be positive, which is the case here.
  3. Whether you detrend the trade balance depends on your philosophical views. Some people want their model to represent filtered empirical data. Other people think the model after filtering should represent the empirical data after filtering.

Dear Prof. Pfeifer

Thank you so much indeed for your answer

in term of the gross interest rate, it is defined as r in your mod file, but then,in the interest rate equation in your mod file (line 152-153), this gross interest rate, r, is identical to the definition of net interest rate in the original paper (see the country premium on page. 2523 of the GPU (2010))

Blockquote
%1. Interest Rate
r = RSTAR + psi*(exp(d-dbar) - 1)+exp(mu-1)-1;

Thus, personally, I think that the equation of the interest rate in the line ( 152-153) in your mod file would be no term (-1) at the end. A corrected gross interest rate would be like

Blockquote
%1. Interest Rate
r = RSTAR + psi*(exp(d-dbar) - 1)+exp(mu-1);

Please kindly let me know if my thinking is correct

Best wishes

No, that thinking is not correct. RSTAR already is a gross interest rate. The term exp(mu-1)-1 is the interest premium shock. If the shock mu=0, then exp(0)=1, so you need the -1 to make the term mean 0.

Dear Prof. @jpfeifer

I got it
Thank you so much indeed
Best wishes

Dear Prof. jpfeifer

I would have a question on the steady state in your mod file in that why three following parameters are equal to 1 at the steady state

line 234

Blockquote
a = 1; %productivity shock

line 239-240

Blockquote
nu = 1;
mu = 1;

Thank you a lots

Best regards

Those are not parameters, but the actual steady state values. Take the equation

log(a)=rho_a * log(a(-1))+eps_a; 

Clearly of a=1 then log(a)=0 so that the equation holds in steady state.

I got it
Thank you a lot prof. Pfeifer

Dear Prof. @jpfeifer

Do you know why GPU (2010) calibrate the depreciation rate as 0.1225
Indeed, in the SS file

Blockquote
delta = 1.03^4-1;%0.03; %Depreciation rate

I do not know how this parameter can be calibrated like this? This calibration is based on the SS level

Blockquote
k_over_gh =((gbar^gamma/beta-1+delta)/alpha)^(1/(alpha-1)); %k/(g*h)

But I check it, it does not match. Then, I check with the solow growth model, at the steady state, this value match neither

What do you mean? They use a three percent quarterly depreciation rate in steady state. The resulting
invest/y is 0.1894, which is the 19 percent they mention as the target.

Dear Prof.Pfeifer

Thank you so much
But how they are related to each other? I mean why the depreciation rate (delta =0.1255) implies an average investment-to-output ratio of 19 percent. Which equation in the steady-state level presents this relation?

It’s a mixture of equations. The discount factor and risk aversion govern the interest rate via the Euler equation. This in turn pins down the capital to labor ratio and therefore output per capita. At the same time, the law of motion for capital determines investment as a share of the capital stock. Put those together and you get the desired result.

Thank you a lot Prof. Pfeifer