# Replication Adolfson 2007

**URL:** <https://forum.dynare.org/t/replication-adolfson-2007/4665>\
**Category:** Macroeconomic Model Data Base\
**Created:** [2 May 2015 14:32 UTC](https://forum.dynare.org/t/replication-adolfson-2007/4665 "2015-05-02T14:32:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kerkkiat](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/e56c9b/32.png) [@kerkkiat](https://forum.dynare.org/u/kerkkiat)\
**Post date:** [2 May 2015 14:32 UTC](https://forum.dynare.org/t/replication-adolfson-2007/4665/1 "2015-05-02T14:32:48Z")

</div>

Hello,  
I am trying to replicate “Adolfson,M. ,S. Laseen, J. Linde, and M. Villani 2007(Bayesian Estimation of an open Economy DSGE model)” with Thailand data and I adopt the baseline code from MMB ([macromodelbase.com/home](http://www.macromodelbase.com/home))

Since I am new Dynare user, I got stuck and I have no idea how wrong it is. Please,help me for some suggestions.

Thank for your suggestions  
Pommin Kerkkit

The code[EA\_SR07\_05\_02.mod](https://forum.dynare.org/uploads/default/original/2X/a/aeef6a33fff773eed2dfe13b880541d926fac44a.mod) (27.2 KB)

---

<div class="post-metadata">

**Author:** ![kerkkiat](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/e56c9b/32.png) [@kerkkiat](https://forum.dynare.org/u/kerkkiat)\
**Post date:** [2 May 2015 14:55 UTC](https://forum.dynare.org/t/replication-adolfson-2007/4665/2 "2015-05-02T14:55:28Z")

</div>

I found this problem but I don’t know what it means.

Configuring Dynare …  
[mex] Generalized QZ.  
[mex] Sylvester equation solution.  
[mex] Kronecker products.  
[mex] Sparse kronecker products.  
[mex] Local state space iteration (second order).  
[mex] Bytecode evaluation.  
[mex] k-order perturbation solver.  
[mex] k-order solution simulation.  
[mex] Quasi Monte-Carlo sequence (Sobol).  
[mex] Markov Switching SBVAR.

Starting Dynare (version 4.4.3).  
Starting preprocessing of the model file …  
Substitution of endo lags \>= 2: added 21 auxiliary variables and equations.  
Found 118 equation(s).  
Evaluating expressions…done  
Computing static model derivatives:

- order 1  
Computing dynamic model derivatives:
- order 1  
Processing outputs …done  
Preprocessing completed.  
Starting MATLAB/Octave computing.

Loading 230 observations from SR\_data\_05\_02.mat

STEADY: numerical initial values or parameters incompatible with the following equations  
5 11 17 19 21 22 28 29 30 32 43 53 55 57 58 64 65 66 68  
Check whether your model in truly linear  
STEADY: numerical initial values or parameters incompatible with the following equations  
Columns 1 through 21  
1 2 3 4 5 6 7 8 9 10 11 12 13 14 16 17 19 21 22 24 26  
Columns 22 through 42  
27 28 29 30 31 32 33 41 42 43 46 47 48 49 51 52 53 55 57 58 59  
Columns 43 through 58  
60 62 64 65 66 67 68 70 72 73 74 75 91 97 98 99  
Check whether your model in truly linear  
STEADY: numerical initial values or parameters incompatible with the following equations  
Columns 1 through 21  
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21  
Columns 22 through 42  
22 23 24 25 26 27 28 29 30 31 32 33 34 35 41 42 43 44 45 46 47  
Columns 43 through 63  
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68  
Columns 64 through 84  
69 70 71 72 73 74 75 76 77 78 85 90 91 93 97 98 99 100 101 103 104  
Columns 85 through 87  
106 107 109  
Check whether your model in truly linear  
Error in computing likelihood for initial parameter values  
??? Error using ==\> print\_info at 80  
The steady state contains NaN or Inf

Error in ==\> print\_info at 80  
error(‘The steady state contains NaN or Inf’)

Error in ==\> initial\_estimation\_checks at 69  
print\_info(info, DynareOptions.noprint, DynareOptions)

Error in ==\> dynare\_estimation\_1 at 179  
oo\_ = initial\_estimation\_checks(objective\_function,xparam1,dataset\_,M\_,estim\_params\_,options\_,bayestopt\_,oo\_);

Error in ==\> dynare\_estimation at 89  
dynare\_estimation\_1(var\_list,dname);

Error in ==\> EA\_SR07\_05\_02 at 1742  
dynare\_estimation(var\_list\_);

Error in ==\> dynare at 180  
evalin(‘base’,fname) ;

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [5 May 2015 15:32 UTC](https://forum.dynare.org/t/replication-adolfson-2007/4665/3 "2015-05-05T15:32:27Z")

</div>

You cannot estimate the model with that mod-file. You are neglecting parameter dependence. After running estimation, Dynare will update the estimated parameters but not take any dependence into account that you did not specify. Rather, your calibration only once updates the other parameters depending on the estimated one. That’s why you should use model-local variables (the ones with the pound operator). See Remark 4 (Parameter dependence and the use of model-local variables) in [Pfeifer(2013): “A Guide to Specifying Observation Equations for the Estimation of DSGE Models”](https://drive.google.com/file/d/1r89OU5OE3CBa6tOlj6l3hNVWEaRH5Anv/view?usp=sharing).  
This will solve your problem.

---

<div class="post-metadata">

**Author:** ![kerkkiat](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/e56c9b/32.png) [@kerkkiat](https://forum.dynare.org/u/kerkkiat)\
**Post date:** [10 May 2015 08:23 UTC](https://forum.dynare.org/t/replication-adolfson-2007/4665/4 "2015-05-10T08:23:49Z")

</div>

Dear Prof. Dr. Johannes Pfeifer

Thank so much for your suggestions. I am trying to follow your suggestions.

Pommin Kerkkit

---

<div class="post-metadata">

**Author:** ![kerkkiat](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/e56c9b/32.png) [@kerkkiat](https://forum.dynare.org/u/kerkkiat)\
**Post date:** [10 May 2015 15:34 UTC](https://forum.dynare.org/t/replication-adolfson-2007/4665/5 "2015-05-10T15:34:09Z")

</div>

Dear Prof. Dr. Johannes Pfeifer

It is me again. I tried to adopt your advice ,but it is still not work. I am not sure whether my code correct or not.  
I found these problems. I have no idea how to solve.

Check whether your model in truly linear  
Error in computing likelihood for initial parameter values

[quote]??? Error using ==\> print\_info at 80  
The steady state contains NaN or Inf

Error in ==\> print\_info at 80  
error(‘The steady state contains NaN or Inf’)

Error in ==\> initial\_estimation\_checks at 69  
print\_info(info, DynareOptions.noprint, DynareOptions)

Error in ==\> dynare\_estimation\_1 at 179  
oo\_ = initial\_estimation\_checks(objective\_function,xparam1,dataset\_,M\_,estim\_params\_,options\_,bayestopt\_,oo\_);

Error in ==\> dynare\_estimation at 89  
dynare\_estimation\_1(var\_list,dname);

Error in ==\> EA\_ALLV07\_05\_10 at 1720  
dynare\_estimation(var\_list\_);

Error in ==\> dynare at 180  
evalin(‘base’,fname) ;[/quote]

Could please correct my code?  
best,  
Pommin Kerkkit

[EA\_ALLV07\_05\_10.mod](https://forum.dynare.org/uploads/default/original/2X/4/4ed41849702170188c247c717c8368b6f90ed481.mod) (27.2 KB)  
[ALLV\_model\_stst.mod](https://forum.dynare.org/uploads/default/original/2X/f/f04d92f09602f3651139b6aa84b8874c9cc790cb.mod) (1.13 KB)

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [17 May 2015 16:52 UTC](https://forum.dynare.org/t/replication-adolfson-2007/4665/6 "2015-05-17T16:52:23Z")

</div>

You still have parameter dependences:

```auto
%Steady state para
b_w=(lambda_w*sigma_L-(1-lambda_w))/((1-beta*xi_w)*(1-xi_w));
eta_0=b_w*xi_w;
eta_1=sigma_L*lambda_w-b_w*(1+beta*xi_w^2);
eta_2=b_w*beta*xi_w;
eta_3=-b_w*xi_w;
eta_4=b_w*beta*xi_w;
eta_5=b_w*xi_w*kappa_w;
eta_6=-b_w*beta*xi_w*kappa_w;
eta_7=1-lambda_w;
eta_8=-(1-lambda_w)*sigma_L;
eta_9=-(1-lambda_w)*tau_y/(1-tau_y);
eta_10=-(1-lambda_w)*tau_w/(1+tau_w);
eta_11=-(1-lambda_w);

pi=mu/mu_z; %A.3
R=(pi*mu_z-tau_k*beta)/((1-tau_k)*beta);%A.2
R_f=nu*R+1-nu; %A.17
eta_mc=lambda_mc/(lambda_mc-1); %Substitution elasticity among imported consumption goods
eta_mi=lambda_mi/(lambda_mi-1);%Substitution elasticity among imported investment goods

gamma_id=((1-omega_i)+omega_i*(eta_mi/(eta_mi-1))^(1-eta_i))^(1/(1-eta_i)); %A.11
gamma_cd=((1-omega_c)+omega_c*(eta_mc/(eta_mc-1))^(1-eta_c))^(1/(1-eta_c)); %A.9
gamma_dc=1/gamma_cd;
gamma_cmc=((1-omega_c)*((eta_mc-1)/eta_mc)^(1-eta_c)+omega_c)^(1/(1-eta_c)); %A.10
gamma_mcc=1/gamma_cmc;
gamma_imi=((1-omega_i)*((eta_mi-1)/eta_mi)^(1-eta_i)+omega_i)^(1/(1-eta_i)); %A.12
gamma_mii=1/gamma_imi;
```

Here, b\_w depends on xi\_w, which has not been defined yet.
