4418 3

[DSGE模型初级教程] 向老师请教参数估计的问题 [推广有奖]

  • 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代码是对数线性化后输入的,也理解了,但是在运行过程中参数估计出了一些问题,因为论文中没有指出稳态值是如何计算的,我感觉模型很难解出稳态值,这个模型除去参数估计的部分是可以运行的,但是参数估计的运行总是报错,我查了很多问答还是认为是因为稳态值设定有误,可以请李老师帮我解答下这个问题吗,dynare代码和论文文件我以附件的形式贴在下方,请多多指教,感谢您

二维码

扫码加我 拉你入群

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

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

关键词:参数估计 dynare dsge模型 一篇论文 DSGE DSGE dynare 参数估计

附件: 你需要登录才可以下载或查看附件。没有帐号?我要注册
已有 1 人评分论坛币 收起 理由
zhuosn + 1 精彩帖子

总评分: 论坛币 + 1   查看全部评分

dynare代码如下,如果没有参数估计的话可以运行,但参数估计始终无法运行:
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;


%参数校准
beta=0.98;
alpha=0.50;
delta=0.025;
gamma=0.299;%土地-中间品相对占比份额
Theta=0.75;%稳态时金融机构贷款占比
cy=0.308503635;%稳态时消费与产出比
R=1.02;%稳态时利率
phi=0.0697;%土地-资本相对占比份额;
%%根据数据计算;
gy=0.235596437;%稳态时地方ZF支出与产出比
iy=0.256917;%稳态时地方投资与产出比
t=0.00269566;%稳态时地方税收与产出比
qlLOY=gy-t;%稳态时土地财政收入与产出比
lhl=0.237751586;%稳态时住宅用地与土地出让面积比
lel=1-lhl;%稳态时工业用地与土地出让面积比
rho_z=0.75;
rho_a=0.75;
rho_psi=0.75;
rho_pphi=0.75;
rho_theta=0.75;

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;
y=ql+l;
end;


initval;
lamda=0.00693023;
c=-0.00693023;
w=-0.00693023;
n=-2.77556e-17;
i=-0.00693023;
y=-0.00693023;
k=-0.00693023;
lh=-0.10636;
le=-0.10636;
ql=0.0994294;
r=-1.18694e-18;
b=-0.00693023;
m=-0.00693023;
h=-0.0366596;
q=0.0297294;
qk=-8.45403e-17;
z=0;
a=0;
psi=0;
pphi=0;
theta=0;
l=-0.10636;
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;


stoch_simul(conditional_variance_decomposition=[1 4 8 16 20]) i,y,l,h,m,le,lh;
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,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;

使用道具

报错提示:
You did not declare endogenous variables after the estimation/calib_smoother command.

initial_estimation_checks:: The forecast error variance in the multivariate Kalman filter became singular.
initial_estimation_checks:: This is often a sign of stochastic singularity, but can also sometimes happen by chance
initial_estimation_checks:: for a particular combination of parameters and data realizations.
initial_estimation_checks:: If you think the latter is the case, you should try with different initial values for the estimated parameters.

ESTIMATION_CHECKS: There was an error in computing the likelihood for initial parameter values.
ESTIMATION_CHECKS: If this is not a problem with the setting of options (check the error message below),
ESTIMATION_CHECKS: you should try using the calibrated version of the model as starting values. To do
ESTIMATION_CHECKS: this, add an empty estimated_params_init-block with use_calibration option immediately before the estimation
ESTIMATION_CHECKS: command (and after the estimated_params-block so that it does not get overwritten):

使用道具

板凳
ahnulxy 发表于 2018-3-6 13:05:40 |只看作者 |坛友微信交流群
关于贝叶斯估计,的确很复杂。从反馈信息来看,这个问题应该不是初始值问题。估计是贝叶斯估计的语法问题:
可能是被估计参数的初始值设置有问题,你可以将被估计参数的初值设置为校准的值试试看。比如类似于这样的设置:
estimated_params_init;
stderr eps_a, 0.019;
rho, 0.82;
lambda, 0.51;
end;

我在国外访学的时候,一位大牛就曾给我们说,贝叶斯估计充满了危险,很难一次运行成功,往往和数据、先验分布及其参数设定有密切关系,需要不断的尝试,比如使用不同的统计数据,使用不同的先验分布参数等。

使用道具

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

本版微信群
加好友,备注jltj
拉您入交流群

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

GMT+8, 2024-4-20 08:32