Replication of DSGE model from chapter 4 of the Handbook of Bayesian Econometrics by Marco Del Negro and Fran Shordfeide (2010)

Hi
I am not yet conversant with Dynare and I am running into issues trying to estimate the neoclassical DSGE model from del negro (2010). I am almost certain my steady-state model is incorrect
CanadaADTData.xlsx (23.3 KB)
but I am unsure how to improve it. I have included my dataset, where I log differenced output and hours worked. The error I am getting is as follows: Residuals of the static equations:

Equation number 1 : 0 : 1
Equation number 2 : 0 : 2
Equation number 3 : 0 : w
Equation number 4 : 0.037071 : r
Equation number 5 : -1.3297 : y
Equation number 6 : 0 : 6
Equation number 7 : 0 : k
Equation number 8 : 0 : 8
Equation number 9 : 0 : a
Equation number 10 : 0 : 10
Equation number 11 : 0 : gy_obs
Equation number 12 : 0 : gh_obs

Error using print_info
The steadystate file did not compute the steady state while simulation has been running.
CanadaADTData.xlsx (23.3 KB)
My .mod is as follows:

var y c k i h w r a A_tilda B gy_obs gh_obs;

/*
y - output 
c - consumption 
k - capital 
i - investment 
h - labor
w - wage
gy_obs- observed output
gh_obs- observed hours worked
r - rental rate of capital
a - technology shock
A_tilda - trend component of technology
B - exogenous preference shifter
*/
varexo e_a e_b; // the exogenous variables


// Parameters that need to be calibrated
parameters beta upsilon delta alpha B_star gamma Rho_a Rho_b sigma_a sigma_b;

%----------------------------------------------------------------
% 2. Calibration
%----------------------------------------------------------------

beta = 0.99; % Discount rate 
upsilon = 2; % Aggregate labor supply elasticity
delta = 0.025; % Depreciation rate of capital
alpha = 0.66; % Output elasticity of capital
B_star = 1; % Exogenous preference shifter level
gamma = 1.03; % Trend growth rate
Rho_a = 0.01; % AR(1) technology shock parameter
Rho_b = 0.8; % AR(1) preference shock parameter
sigma_a = 0.01;
sigma_b = 0.01;
%----------------------------------------------------------------
% 3. Model
%----------------------------------------------------------------
model;
    1/c = beta*((1/c(+1))*exp(-a(+1))*(r(+1) + (1 - delta)));
    (1/c)*w = (1/B)*(h/B)^(1/upsilon);
    w = (1-alpha)*y/h;
    r = (1-alpha)*(y/k)*exp(a);
    y = (h^alpha)*(k*exp(-a))^(1 - alpha);
    y = c + i;
    k = (1 - delta)*k(-1)*exp(-a) + i;
    
    // Log-linearized technology shock process
    log(A_tilda) = Rho_a*log(A_tilda(-1)) + e_a;
    a = log(gamma) + (Rho_a - 1)*log(A_tilda(-1)) + e_a;

    // Exogenous preference shifter process
    log(B) = (1 - Rho_b)*log(B_star) + Rho_b*log(B(-1)) + e_b;
    // measurement equation for gy_obs
    gy_obs= y-y(-1);
    // measurement equation for gh_obs
    gh_obs= h-h(-1);
end;

varobs gy_obs gh_obs; // output and hours worked 
steady_state_model;

    // Technology Adjustment (a = log(gamma) in steady state)
    a = log(gamma);
   // Exogenous preference shifter process (B = 1 in steady state)
    B = 1;
    A_tilda=1;
    // Define steady-state values for h, k, and y
    h = 1;  // 
    k=1;
    
    // Production Function (using k)
    y = h^alpha * k^(1 - alpha)* (1/gamma)^(1-alpha);
    
    // Wage Equation
    w = (1 - alpha) * y / h;
    
    // Labour Supply and Demand Equation (c in terms of w and h)
    c = w / h^(1 / upsilon);
    
    // Interest Rate Equation (r in terms of beta, gamma, and delta)
     //r = (1-alpha)*(y/k)*gamma;
    
    
    // Euler Equation (R in terms of gamma, beta, and delta)
    r = (gamma/beta)-(1-delta);
    
    // Capital Accumulation Equation (i = y - c)
    i = y - c;
     
     // Now, calculate k from the investment equation:
    //k = i / (1 - (1 - delta) * (1 / gamma));
   
    // Resource Constraint (y = c + i is already ensured by the equation above)
    // Define the steady-state values for variables
    k = i / (1 - (1 - delta) * (1 / gamma));
    
    // Measurement Equation for Output Growth (gy_obs)
    gy_obs = 0;
    
    // Measurement Equation for Labour Growth (gh_obs)
    gh_obs = 0;
    
end;

What makes sure that

    h = 1;  // 
    k=1;

are indeed the steady states?

I am almost certain they are not. However, I have been struggling with writing the steady states sequentially otherwise. I defined k as k = i / (1 - (1 - delta) * (1 / gamma)); further in the steady state model block. I am keen to be directed on how I can correct this so the estimations runs.

Have a look at the working paper version:


This is an equation system you can solve analytically.

Thank you. Do you have any resources I can look at to guide me as I solve analytically? I appreciate the help so far.

A rough outline is
\begin{gathered} I = \left( {1 - \left( {1 - \delta } \right){e^{ - a}}} \right)K \hfill \\ C = Y - I = Y - \left( {1 - \left( {1 - \delta } \right){e^{ - a}}} \right)K \hfill \\ \frac{W}{C} = {H^{\frac{1}{\upsilon }}} \hfill \\ \frac{{\alpha \frac{Y}{H}}}{C} = {H^{\frac{1}{\upsilon }}} \hfill \\ \frac{{\alpha Y}}{C} = {H^{\frac{{\upsilon + 1}}{\upsilon }}} \hfill \\ \frac{{\alpha Y}}{{Y - \left( {1 - \left( {1 - \delta } \right){e^{ - a}}} \right)K}} = {H^{\frac{{\upsilon + 1}}{\upsilon }}} \hfill \\ \frac{\alpha }{{1 - \left( {1 - \left( {1 - \delta } \right){e^{ - a}}} \right)\frac{K}{Y}}} = {H^{\frac{{\upsilon + 1}}{\upsilon }}} \hfill \\ {\left[ {\frac{\alpha }{{1 - \left( {1 - \left( {1 - \delta } \right){e^{ - a}}} \right)\frac{K}{Y}}}} \right]^{\frac{\upsilon }{{\upsilon + 1}}}} = H \hfill \\ Y = {H^\alpha }{\left( {K{e^{ - a}}} \right)^{1 - \alpha }} \hfill \\ \frac{Y}{K} = {\left( {\frac{H}{K}} \right)^\alpha }{\left( {{e^{ - a}}} \right)^{1 - \alpha }} \hfill \\ \frac{Y}{K}{\left( {{e^{ - a}}} \right)^{\alpha - 1}} = {\left( {\frac{H}{K}} \right)^\alpha } \hfill \\ {\left( {\frac{Y}{K}{{\left( {{e^{ - a}}} \right)}^{\alpha - 1}}} \right)^{\frac{1}{\alpha }}} = \frac{H}{K} \hfill \\ K = \frac{H}{{{{\left( {\frac{Y}{K}{{\left( {{e^{ - a}}} \right)}^{\alpha - 1}}} \right)}^{\frac{1}{\alpha }}}}} \hfill \\ \end{gathered}

DelNegroSchorfheide2010.mod (3.1 KB)