Replication Adolfson 2007

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Replication Adolfson 2007

Postby kerkkiat » Sat May 02, 2015 2:32 pm

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 (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
The code
(27.21 KiB) Downloaded 122 times
Last edited by kerkkiat on Sat May 02, 2015 3:35 pm, edited 3 times in total.
kerkkiat
 
Posts: 9
Joined: Mon Mar 30, 2015 6:49 am

Re: Replication Adolfson 2007

Postby kerkkiat » Sat May 02, 2015 2:55 pm

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) ;
kerkkiat
 
Posts: 9
Joined: Mon Mar 30, 2015 6:49 am

Re: Replication Adolfson 2007

Postby jpfeifer » Tue May 05, 2015 3:32 pm

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://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf.
This will solve your problem.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Replication Adolfson 2007

Postby kerkkiat » Sun May 10, 2015 8:23 am

Dear Prof. Dr. Johannes Pfeifer

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

Pommin Kerkkit
kerkkiat
 
Posts: 9
Joined: Mon Mar 30, 2015 6:49 am

Re: Replication Adolfson 2007

Postby kerkkiat » Sun May 10, 2015 3:34 pm

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
??? 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) ;





Could please correct my code?
best,
Pommin Kerkkit

EA_ALLV07_05_10.mod
(27.2 KiB) Downloaded 95 times

ALLV_model_stst.mod
(1.13 KiB) Downloaded 99 times
kerkkiat
 
Posts: 9
Joined: Mon Mar 30, 2015 6:49 am

Re: Replication Adolfson 2007

Postby jpfeifer » Sun May 17, 2015 4:52 pm

You still have parameter dependences:
Code: Select all
%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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 7 guests