楼主: 白痴…
1585 1

[DSGE讨论专题] 粘性价格不完全竞争,请各位大佬指正,困扰几天了 [推广有奖]

  • 0关注
  • 0粉丝

本科生

6%

还不是VIP/贵宾

-

威望
0
论坛币
1238 个
通用积分
0.3078
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
277 点
帖子
11
精华
0
在线时间
143 小时
注册时间
2013-3-23
最后登录
2024-3-22

楼主
白痴… 发表于 2021-4-27 00:38:30 |AI写论文
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

关键词:不完全竞争 完全竞争 accumulation diagnostics parameters
已有 1 人评分经验 论坛币 收起 理由
linmengmiki + 100 + 100 鼓励积极发帖讨论

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

沙发
a649933177 学生认证  发表于 2021-7-7 11:20:37
大致看了一下,你好像是两个辅助方程写错了,即x1和x2。两个辅助方程等号右边第一项都漏了lambda,可以与DSGE相关的数据对照看看

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

本版微信群
jg-xs1
拉您进交流群
GMT+8, 2025-12-25 04:56