最近在做dsge的论文,在研究一篇论文的基础上实现模型,dynare运行stoch_simul都没问题,可以打印正常的图出来,就是estimation运行的时候总是报错,希望高手能帮忙指点一下,感激不尽,这里是代码
var
lamda c w n i y k lh le ql r b m h q qk z a psi pphi theta l DLogy DLogl DLoglh;
varexo Eps_z Eps_a Eps_psi Eps_pphi Eps_theta;
parameters
beta alpha delta gy t rho_z rho_a rho_psi rho_pphi rho_theta iy phi lhl lel gamma qlLOY cy R Theta;
rho_z=0.75;
rho_a=0.75;
rho_psi=0.75;
rho_pphi=0.75;
rho_theta=0.75;
%参数校准
beta=0.98;
alpha=0.50;
delta=0.025;
gamma=0.299;%土地-中间品相对占比份额
Theta=0.75;%稳态时金融机构贷款占比
cy=0.38;%稳态时消费与产出比
R=1.02;%稳态时利率
phi=0.0697;%土地-资本相对占比份额;
%%根据数据计算;
gy=0.165;%稳态时地方ZF支出与产出比
iy=0.2959;%稳态时地方投资与产出比
qlLOY=0.0786;%稳态时土地财政收入与产出比
t=gy-qlLOY;%稳态时地方税收与产出比
lhl=0.235;%稳态时住宅用地与土地出让面积比
lel=0.700;%稳态时工业用地与土地出让面积比
model(linear);
#IK=delta;
#my=1-gy-cy-iy;
#YK=IK/iy;
#YLeQl=(1+beta*Theta-Theta/R)/(alpha*phi*(1-t));
#ThetaQk=(alpha*beta*(1-t)*(1-phi)*YK-1+beta*(1-delta))/(beta-1/R);
#BY=Theta/YLeQl+ThetaQk/YK;
#dd=(1-alpha)*(1-t)+BY-cy-BY/R;
%%家庭
lamda+c=a;
lamda+ql+h=a+phi;
a+psi=lamda+w;
lamda=lamda(+1)+r;
cy*c+dd*(q+h)+BY/R*(b-r)=(1-alpha)*(1-t)*(w+n)+BY*b(-1);
%%厂商
y=z+alpha*phi*le+alpha*(1-phi)*k+(1-alpha)*n;
k(+1)=(1-delta)*k+IK*i;
(1-t)*alpha*phi*YLeQl*(y-le)+Theta/R*(theta+ql-r)=(1+beta*Theta)*ql+beta*Theta*theta;
alpha*beta*(1-t)*(1-phi)*YK*(y(+1)-k(+1))+ThetaQk/R*(theta+qk-r)=beta*ThetaQk*(theta+qk);
y-n=w;
BY*b=Theta/YLeQl*(theta+ql+le)+ThetaQk/YK*(qk+k(+1));
%%房地产商
m=q+h;
q+h=ql+lh;
h=(1-gamma)*m+gamma*lh;
%%ZF
(1-gy)*y=cy*c+iy*i+my*m;
l=lel*le+lhl*lh;
%%输入项
DLogy=y-y(-1);
DLogl=l-l(-1);
DLoglh=lh-lh(-1);
%%冲击效应
a=rho_a*a(-1)+Eps_a;
pphi=rho_pphi*pphi(-1)+Eps_pphi;
psi=rho_psi*psi(-1)+Eps_psi;
z=rho_z*z(-1)+Eps_z;
theta=rho_theta*theta(-1)+Eps_theta;
%log(a)=rho_a*log(a(-1))+Eps_a;
%log(pphi)=rho_pphi*log(pphi(-1))+Eps_pphi;
%log(psi)=rho_psi*log(psi(-1))+Eps_psi;
%log(z)=rho_z*log(z(-1))+Eps_z;
%log(theta)=rho_theta*log(theta(-1))+Eps_theta;
y=ql+l;
end;
initval;
lamda=0;
c=0;
w=0;
n=0;
i=0;
y=0;
k=0;
lh=0;
le=0;
l=0;
ql=0;
q=0;
h=0;
m=0;
qk=0;
b=0;
r=0;
z=0;
a=0;
psi=0;
pphi=0;
theta=0;
DLogy=0;
DLogl=0;
DLoglh=0;
end;
steady;
check;
shocks;
var Eps_z;stderr 0.01;
var Eps_a;stderr 0.01;
var Eps_psi;stderr 0.01;
var Eps_pphi;stderr 0.01;
var Eps_theta;stderr 0.01;
end;
varobs DLogy DLogl DLoglh;
estimated_params;
rho_z,beta_pdf,0.5,0.1;
rho_a,beta_pdf,0.5,0.1;
rho_psi,beta_pdf,0.5,0.1;
rho_pphi,beta_pdf,0.5,0.1;
rho_theta,beta_pdf,0.5,0.1;
stderr Eps_z,inv_gamma2_pdf,0.01,inf;
stderr Eps_a,inv_gamma2_pdf,0.01,inf;
stderr Eps_psi,inv_gamma2_pdf,0.01,inf;
stderr Eps_pphi,inv_gamma2_pdf,0.01,inf;
stderr Eps_theta,inv_gamma2_pdf,0.01,inf;
end;
estimation(datafile=dataone,nobs=23,first_obs=2,plot_priors=0,mode_compute=4,mh_replic=10000,mh_nblocks=10,bayesian_irf,irf=40,conf_sig=0.9) i y ql r b q h m n;
stoch_simul(conditional_variance_decomposition=[1 4 8 16 20]) i,y,l,h,m;
运行中出现如下问题:
> dynare doctorhe.mod
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.
Using 64-bit preprocessor
Starting Dynare (version 4.5.3).
Starting preprocessing of the model file ...
Found 25 equation(s).
Evaluating expressions...done
Computing static model derivatives:
- order 1
Computing dynamic model derivatives:
- order 1
- order 2
Processing outputs ...
done
Preprocessing completed.
STEADY-STATE RESULTS:
lamda 0.0904919
c -0.0904919
w -0.0904919
n -0.139245
i -0.278905
y -0.229737
k -0.278905
lh -1.11292
le -0.871787
ql 0.64205
r -7.6642e-20
b -0.46463
m -0.470869
h -0.662842
q 0.191973
qk -0.185745
z 0
a 0
psi 0
pphi 0
theta 0
l -0.871787
DLogy 0
DLogl 0
DLoglh 0
EIGENVALUES:
Modulus Real Imaginary
0 0 0
1.966e-16 -1.966e-16 0
6.263e-15 -6.263e-15 0
0.75 0.75 0
0.75 0.75 0
0.75 0.75 0
0.75 0.75 0
0.75 0.75 0
0.9993 0.9993 0
1.014 1.014 0
1.034 1.034 0
1549 1549 0
There are 3 eigenvalue(s) larger than 1 in modulus
for 3 forward-looking variable(s)
The rank condition is verified.
警告: 执行 'onCleanup' 类析构函数时,捕获到以下错误:
类 COM.excel_application 没有适当的方法、属性或字段 Quit。
> In load_xls_file_data at 77
In dseries.dseries at 130
In makedataset at 121
In dynare_estimation_init at 538
In dynare_estimation_1 at 115
In dynare_estimation at 105
In doctorhe at 364
In dynare at 223
错误使用 xlsread (line 247)
类 COM.excel_application 不存在公共字段 DisplayAlerts。
出错 load_xls_file_data (line 77)
[num,txt,raw] = xlsread(file, sheet, range);
出错 dseries (line 130)
[freq,init,data,varlist] =
load_xls_file_data(varargin{1}, sheet, range);
出错 makedataset (line 121)
DynareDataset = dseries(datafile);
出错 dynare_estimation_init (line 538)
[dataset_, dataset_info, newdatainterfaceflag] =
makedataset(options_,
options_.dsge_var*options_.dsge_varlag, gsa_flag);
出错 dynare_estimation_1 (line 115)
[dataset_, dataset_info, xparam1, hh, M_, options_, oo_,
estim_params_, bayestopt_, bounds] = ...
出错 dynare_estimation (line 105)
dynare_estimation_1(var_list,dname);
出错 doctorhe (line 364)
oo_recursive_=dynare_estimation(var_list_);
出错 dynare (line 223)
evalin('base',fname) ;
希望大神能够指点一下,感激不尽