2417 4

[DSGE讨论专题] 紧急求助Dynare运到estimation报错 [推广有奖]

  • 0关注
  • 0粉丝

本科生

43%

还不是VIP/贵宾

-

威望
0
论坛币
91 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
678 点
帖子
9
精华
0
在线时间
177 小时
注册时间
2016-8-4
最后登录
2024-1-23

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
最近在做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) ;


希望大神能够指点一下,感激不尽
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Estimation dynare ATION 紧急求助 Tima DSGE Dynare 宏观经济

已有 1 人评分经验 论坛币 收起 理由
linmengmiki + 100 + 100 鼓励积极发帖讨论

总评分: 经验 + 100  论坛币 + 100   查看全部评分

沙发
becauseofuu 学生认证  发表于 2020-2-5 21:04:33 |只看作者 |坛友微信交流群
你写得是土地财政和房价相关的吗

使用道具

藤椅
胖仔1 学生认证  发表于 2020-3-1 19:48:09 |只看作者 |坛友微信交流群
请问解决了么

使用道具

板凳
空降东京 发表于 2020-4-6 11:22:48 |只看作者 |坛友微信交流群
k是在t决定的,需要把生产函数中的k改为k(-1),把euler equation中的k(+1)改为k。以此类推

使用道具

报纸
景转心镜 发表于 2020-8-4 22:01:40 |只看作者 |坛友微信交流群
你试试看是不是这个原因。
shocks 只有5个,而你的数据有9个。数据应该最多也只能选5个出来。

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加JingGuanBbs
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-20 11:57