全部版块 我的主页
论坛 经济学论坛 三区 宏观经济学
1532 1
2021-04-27
悬赏 20 个论坛币 未解决
Impossible to find the steady state (the sum of square residuals of the static equations is 26.2309). Either the model doesn't have a steady state,
there are an infinity of steady states, or the guess values are too far from the solution

把代码贴出来了,假设是不完全竞争和价格粘性,感觉要素需求方程和边际成本方程有问题
clc;
close all;
var C I K L Y r w x1 x2 pi pi_star A dt mc ;
varexo ea ;
parameters sigma phi alpha beta delta rho_a psi theta sigma_a mar1 mar2 mar3;
parameters Css Iss Kss Lss Yss rss wss x1ss x2ss piss pi_starss Ass dtss mcss;

sigma=2;  %风险厌恶系数
phi=1.5;  %Frisch弹性倒数
alpha=0.35; %资本的产出弹性
beta=0.99;  %贴现因子
delta=0.025;  %折旧率
rho_a=0.95;   %技术冲击自回归系数
theta=0.75;   %价格粘性参数
psi=10;  %中间产品替代弹性
sigma_a=0.01;

%model_diagnostics(M_,options_,oo_) 诊断线性相关方程
%稳态计算

Ass=1;
piss=1;
pi_starss=1;
dtss=1;
rss=1/beta-1+delta;
mcss=(psi-1)/psi;
%wss=mcss*(1-alpha)*((rss/mcss/alpha)^(alpha/(1-alpha)));
wss=((mcss/((rss/alpha)^alpha))^(1/(1-alpha)))*(1-alpha);
L_K=((mcss/wss)*(1-alpha))^(1/alpha);
Y_K=L_K^(1-alpha);

mar1=(Y_K-delta)^sigma;
mar2=(L_K)^phi;
mar3=1/(sigma+phi);
Kss=(wss/mar1/mar2)^mar3;
Iss=delta*Kss;
Lss=Kss*rss*(1-alpha)/alpha/wss;
Yss=Y_K*Kss;
Css=Yss-delta*Kss;
x1ss=mcss*Yss/(1-theta*beta);
x2ss=Yss/(1-theta*beta);

model;
%(1) home Euler equation资本存量的一阶条件
exp(-sigma*C) = beta * exp(-sigma*(C(+1)))*((r(+1))+1-delta);

%(2) labor supply 劳动供给
exp(sigma*C)*exp(phi*L)=exp(w);

%(3) the accumulation of capital 资本积累方程
exp(K)=(1-delta)*exp(K(-1))+exp(I);

%(4) the auxiliary x1
exp(x1) = exp(Y)*exp(mc) +theta*beta*exp(psi*pi(+1))*exp(x1(+1));

%(5) the auxiliary x2
exp(x2) = exp(Y)+theta*beta*exp((psi-1)*pi(+1))*exp(x2(+1));

%(6)the sticky price equation 粘性价格方程
exp(pi_star) = psi/(psi-1)*exp(pi)*exp(x1)/exp(x2);

%(7) the price dispersion 价格离散核
exp(dt) = (1-theta)*exp(-psi*pi_star)*exp(psi*pi) + exp(psi*pi) *theta*exp(dt(-1));

%(8) general price level 一般价格水平
exp((1-psi)*pi) = (1-theta)*exp((1-psi)*pi_star) + theta;

%(9) the production technology 加总的生产技术
exp(Y) = exp(A) *exp(alpha*K(-1))*exp((1-alpha)*L)/exp(dt);

%(10) accounting identity 资源约束
exp(C)+exp(I)= exp(Y);

%() marginal cost equation 边际成本方程
%exp(mc) =exp(L*alpha)*exp(K(-1)*(-alpha)) /exp(A)/(1-alpha);


%()the ratio of K/L  资本劳动比
%exp(K(-1))*r*(1-alpha)=exp(L)*exp(w)*alpha;

%(11) technology shock 技术冲击
A = rho_a*A(-1) + ea;

%(12)the demand for capital
r=exp(mc)*alpha*exp(A)*exp(K(-1)*(alpha-1))*exp(L*(1-alpha));

%(13)the demand for labor
exp(w)=exp(mc)*(1-alpha)*exp(A)*exp(alpha*K(-1))*exp(-alpha*L);

%(14)用要素价格标示的边际成本方程
exp(mc)*exp(A)*((1-alpha)^(1-alpha))*(alpha^alpha)=exp(w*(1-alpha))*(r^alpha);

end;

initval;
C=log(Css);
I=log(Iss);
K=log(Kss);
L=log(Lss);
Y=log(Yss);
r=log(rss);
w=log(wss);
mc=log(mcss);
A = log(Ass);
dt = log(dtss);
pi_star = log(pi_starss);
pi=log(piss);
x1 = log(x1ss);
x2 = log(x2ss);
end;

shocks;
var ea;
stderr 1;
end;


steady;
check;


stoch_simul(order=1) C I K L Y ;
1619454923(1).png

原图尺寸 4.64 KB

1619454923(1).png

二维码

扫码加我 拉你入群

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

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

全部回复
2021-7-7 11:20:37
大致看了一下,你好像是两个辅助方程写错了,即x1和x2。两个辅助方程等号右边第一项都漏了lambda,可以与DSGE相关的数据对照看看
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群