Lubik & Schorfheide JME (2007)

Dear all,

I’m trying to simulate an open economy new keynesian model as in Lubik & schorfheide JME (2007) and many others.
I keep getting the following error message:

??? Error: Unexpected MATLAB expression.

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

Any idea on what’s going on? Below is my .mod file.

Any help is greatly appreciated.

Thanks,
Rodrigo

===============================================

periods 1000;

var y, phi, r, q, exch, A, phistar, ystar;

varexo er, eq, eystar, ephistar, ez;

parameters beta, tau, k, alpha, rhor, rhoq, rhoystar, rhophistar, rhoz, gamma1, gamma2, gamma3;

beta=0.96;
tau=0.5;
k=0.5;
alpha=0.10;
rhor=0.5;
rhoq=0.4;
rhoystar=0.9;
rhophistar=0.8;
rhoz=0.2;
gammma1=1.5;
gammma2=0.25;
gammma3=0.25;

model(linear);
y=y(+1)-(tau+alpha*(2-alpha)(1-tau))(r-phi(+1))-rhoz*(A-A(-1))-alpha*(tau+alpha*(2-alpha)(1-tau))q(+1)+alpha(2-alpha)((1-tau)/tau)(ystar);
phi=beta
phi(+1)+alphabetaq(+1)-(alphaq)+(k/(tau+alpha(2-alpha)(1-tau)))(y+alpha*(2-alpha)((1-tau)/tau)ystar);
r=rhor
r(-1)+(1-rhor)
(gamma1phi+gamma2y+gamma3exch)+er;
exch=phi-(1-alpha)q-phistar;
q=rhoq
q(-1)+eq;
A=A(-1)+ez;
phistar=rhophistar
phistar(-1)+ephistar;
ystar=rhoystar*ystar(-1)+eystar;
end;

shocks;
var er; stderr 0.01;
var eq; stderr 0.01;
var ez; stderr 0.01;
var eystar; stderr 0.01;
var ephistar; stderr 0.01;
end;

stoch_simul(drop=200);

Don’t put periods=xxxx as a independent line. It is a option in simul or sotck_simul.

After correcting the model, I don’t get the technology shock to behave like in the paper. Output in the paper goes to a persistent higher level, while the .mod file here only give a transitory technology shock.

Any thoughts?

The equation A=A(-1)+ez is problematic.
I guess A is the technology shock. Your specification shows it is a non-stationary process. You should either convert it into a stationary process by detrend everything relevant with level of A or you need to specify it in Dynare. I forget what the command in dynare is.

Hi,

does anybody realized how to deal with the variable A in this model? I am also struggling with a similar problem…

Best,
Pedro

I think it should work if you define the difference in A as a variable, so just write the model with dA where dA = A-A(-1).

Hi All,

I cannot understand what is going on. The graphs with the priors keep coming to my screen until I stop it. I get the following:
It seems to be something more basic, the error messages seem to be related to some graph of the priors or how dynare deals with the data (although I am not 100% sure about the model).
Thanks for any comment,

Pedro

dynare teste

Configuring Dynare …
[mex] Generalized QZ.
[m] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.

Starting Dynare …
Starting preprocessing of the model file …
8 equation(s) found
Processing derivation …
Processing Order 1… done
Processing Order 2… done
Processing outputs …
Preprocessing completed.
Starting Matlab computing …

??? Error using ==> print
Error using ==> graphics\private\restore
Invalid handle object.

Error in ==> plot_priors at 154
eval('print -dpdf ’ M_.fname ‘_Priors’ int2str(nbplt)]);

Error in ==> dynare_estimation_1 at 92
plot_priors

Error in ==> dynare_estimation at 62
dynare_estimation_1(var_list,varargin{:});

Error in ==> teste at 216
dynare_estimation(var_list_);

Error in ==> read_variables at 42
eval(dyn_instr_01);

Error in ==> dynare_estimation_1 at 237
rawdata = read_variables(options_.datafile,options_.varobs,],options_.xls_sheet,options_.xls_range);

Error in ==> dynare_estimation at 62
dynare_estimation_1(var_list,varargin{:});

Error in ==> teste at 216
dynare_estimation(var_list_);

Error in ==> read_variables at 42
eval(dyn_instr_01);

Error in ==> dynare_estimation_1 at 237
rawdata = read_variables(options_.datafile,options_.varobs,],options_.xls_sheet,options_.xls_range);

Error in ==> dynare_estimation at 62
dynare_estimation_1(var_list,varargin{:});

Error in ==> teste at 216
dynare_estimation(var_list_);

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

Hi everybody,

I am working on a extension of LS2007, but first I want to replicate their model and estimation on Dynare. Even before estimation, I’m trying to replicate their impulse response functions by calibrating the model at the posterior means that they obtain. Well, something is not working out for me to get this done. For instance, comparing the IRF I get to a monetary shock and what they get, it is very clear that there is something off.

Attached is the code. I would really appreciate any comments.

Best,
Cocoa
LS2007.mod (4.84 KB)