I want to decompose a historical time series with my DSGE model using calibrated parameters. But I always get the following error:
....
Loading 84 observations from Data2012GER.mat
??? Attempt to reference field of non-structure array.
Error in ==> evaluate_smoother at 117
if all(abs(oo_.steady_state(bayestopt_.mfys))<1e-9)
Error in ==> shock_decomposition at 60
oo = evaluate_smoother(parameter_set);
Error in ==> l_model at 527
oo_ = shock_decomposition(M_,oo_,options_,var_list_);
Error in ==> dynare at 120
evalin('base',fname) ;
My code line is the following, maybe there is something wrong??
- Code: Select all
var Z Qd Qm C I Pd Pm K L Px RK W e Qx B Y Rstar RD A ZL Pstar Zstar G ZC ExPr Ex Im Pxx risk lam lamplus AZ;
varexo eps_A eps_ZL eps_G eps_Zstar eps_ZC eps_Pxx eps_r eps_AZ;
parameters kappa alphad vartheta alpha eta nu delta psi beta gamma Phi phiPx phiPd A0
Lss Zss Css Kss Iss RDss Rstarss Qdss Qxss Qmss Pmss Pdss Pxss Pstarss Zstarss Yss ess Wss Rss kss
Gss b
rhoZL rhoA rhoG rhoZstar rhoZC
sigmaZL sigmaA sigmaG sigmaZstar sigmaZC
phiPm
corrZP alphax sigmaPxx rhoPxx
rhoE
rhoZ
rhoD
rhoV
kappae
sigmar
rhor
rhoEr
rhoZr
rhoF
rhoS
rhoDr
phiL
bL
sigmaAZ
rhoAZ
;
%----------------------------------------------------------------
% 2. P a r a m e t e r s
%----------------------------------------------------------------
sigmaA =
0.008416666584714;
sigmaZL =
0.001001342353004;
sigmaZstar =
0.015917168370728;
sigmaZC =
0.034143136170861;
rhoA =
0.623188359221053;
rhoZL =
0.500360625286618;
rhoZstar =
0;
rhoZC =
0.500003173707171;
gamma =
0.164390203197104;
kappa =
0.001000034216665;
Phi =
6.494467804536654;
eta =
2.969863210704255;
vartheta =
0.300006842703822;
alphad =
0.680000000000000;
psi =
4.540717591968817;
b =
4.682749673000000e-06;
phiPd =
5.408003330600000e-05;
phiPx =
7.783879062100001e-05;
sigmaG =
0.008081053294322;
rhoG =
0.521900000000000;
alpha =
0.330000000000000;
Gss =
0.250005357897742;
nu =
5.500000000000000;
beta =
0.990000000000000;
phiPm =
6.753043553900001e-05;
delta =
0.044999357069038;
sigmaPxx =
0.001008385638963;
rhoPxx =
0;
corrZP =
0;
alphax =
0.543608486859921;
rhoE =
0.500090080068226;
rhoZ =
0;
rhoD =
0;
rhoV =
0.505223825864200;
kappae =
0.342469317014898;
rhor =
0;
sigmar =
0;
rhoEr =
0;
rhoZr =
0;
rhoF =
0;
rhoS =
0;
rhoDr =
0;
phiL =
4.280186705500000e-05;
bL =
0.059537331525254;
sigmaAZ =
0.002626502126124;
rhoAZ =
0.848531027221002;
A0 = 1;
Zstarss = 1;
paramsaux = [alphad,alpha,gamma,delta,Phi,vartheta,eta,psi,beta,kappa,Zstarss,Gss,nu,A0,b,alphax,bL];
ss = steadystateRSOE(paramsaux);
Qdss = ss(1);
Rss = ss(2);
Qmss = ss(3);
Zss = ss(4);
Qxss = ss(5);
Pdss = ss(6);
Pmss = ss(7);
ess = ss(8);
Pxss = ss(9);
kss = ss(10);
Lss = ss(11);
Kss = ss(12);
Iss = ss(13);
Css = ss(14);
Wss = ss(15);
Pstarss = ss(16);
Yss = Zss;
RDss = 1/beta - 1;
Rstarss = RDss;
Bss = 0;
%--------------------------------------------------------------------------
% 3. M o d e l
%--------------------------------------------------------------------------
model(linear);
...
end;
%--------------------------------------------------------------------------
% 4. C o m p u t a t i o n
%--------------------------------------------------------------------------
initval;
Pd = 0;
Px = 0;
Pm = 0;
Z = 0;
Qd = 0;
Qm = 0;
Qx = 0;
RD = 0;
Rstar = 0;
K = 0;
I = 0;
L = 0;
W = 0;
RK = 0;
C = 0;
e = 0;
Y = 0;
B = 0;
ExPr = 0;
Ex = 0;
A = 0;
ZL = 0;
G = 0;
Zstar = 0;
Pstar = 0;
ZC = 0;
Pxx = 0;
risk = 0;
AZ = 0;
end;
steady;
check;
shocks;
var eps_ZL = (sigmaZL)^2;
var eps_A = (sigmaA)^2;
var eps_G = (sigmaG)^2;
var eps_Zstar = (sigmaZstar)^2;
var eps_ZC = (sigmaZC)^2;
corr eps_Pxx, eps_Zstar = corrZP;
var eps_Pxx = (sigmaPxx)^2;
var eps_r = (sigmar)^2;
var eps_AZ = (sigmaAZ)^2;
end;
stoch_simul(order = 1, irf=0, drop=0, periods = 0);
varobs Y L Ex Im ExPr Pm L I C;
shock_decomposition(parameter_set=calibration,datafile='Data2012GER.mat') Y L Ex Im ExPr Pm L I C;