Lubik & Schorfheide JME (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.

Lubik & Schorfheide JME (2007)

Postby Rodrigos » Mon Apr 14, 2008 3:29 pm

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)+alpha*beta*q(+1)-(alpha*q)+(k/(tau+alpha*(2-alpha)*(1-tau)))*(y+alpha*(2-alpha)*((1-tau)/tau)*ystar);
r=rhor*r(-1)+(1-rhor)*(gamma1*phi+gamma2*y+gamma3*exch)+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);
Rodrigos
 
Posts: 2
Joined: Mon Apr 07, 2008 4:48 am

Postby bigbigben » Tue Apr 15, 2008 4:47 pm

Don't put periods=xxxx as a independent line. It is a option in simul or sotck_simul.
bigbigben
 
Posts: 171
Joined: Sun May 28, 2006 1:19 am

Re: Lubik & Schorfheide JME (2007)

Postby bk » Tue Oct 28, 2008 10:35 am

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?
bk
 
Posts: 14
Joined: Tue Jan 08, 2008 12:16 pm

Re: Lubik & Schorfheide JME (2007)

Postby bigbigben » Sun Nov 30, 2008 7:48 pm

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.
bigbigben
 
Posts: 171
Joined: Sun May 28, 2006 1:19 am

Re: Lubik & Schorfheide JME (2007)

Postby pedroac81 » Mon May 18, 2009 5:26 pm

Hi,

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

Best,
Pedro
pedroac81
 
Posts: 14
Joined: Thu May 14, 2009 4:04 am

Re: Lubik & Schorfheide JME (2007)

Postby otb » Tue May 19, 2009 11:28 pm

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).
otb
 
Posts: 26
Joined: Mon Apr 07, 2008 4:47 pm

Re: Lubik & Schorfheide JME (2007)

Postby pedroac81 » Fri May 22, 2009 5:13 am

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) ;
pedroac81
 
Posts: 14
Joined: Thu May 14, 2009 4:04 am

Re: Lubik & Schorfheide JME (2007)

Postby cocoa » Thu Jul 16, 2009 5:37 pm

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
Attachments
LS2007.mod
(4.84 KiB) Downloaded 868 times
cocoa
 
Posts: 5
Joined: Wed Apr 29, 2009 9:15 pm


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 13 guests