楼主: WYXScarlett
659 0

[问答] dynare 稳态求帮助 [推广有奖]

  • 0关注
  • 0粉丝

小学生

42%

还不是VIP/贵宾

-

威望
0
论坛币
0 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
50 点
帖子
1
精华
0
在线时间
24 小时
注册时间
2024-7-29
最后登录
2025-5-18

楼主
WYXScarlett 发表于 2024-11-25 20:20:13 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
命令如下:
var w i G Y Kstar RK pistar u m dp gm wg A pi C N K I X1 X2 mc;
varexo em eg ea;
parameters psi eta sigma gamma rho_g rho_m alpha delta eps_p theta beta phi rho_a omega_g;
parameters dps ws is Gs Ys Kstars RKs pistars  us ms wgs As pis;
parameters Cs Ns Ks Is X1s X2s  mcs sigmaa sigmam sigmag ;

beta=.99;
eta=1;
sigma=2;
gamma=1;
alpha=1/3;
delta=0.025;
theta=0.75;
phi=1;
omega_g=0.2;
eps_p=11;
rho_g=0.5;
rho_a=0.5;
rho_m=0.5;
sigmaa=0.01;
sigmam=0.01;
sigmag=0.01;
psi=0.75;
is=1/beta;
ms=97.4;
Ys=0.982;
Kstars=8.51;
Cs=0.573;
Is=0.213;
ws=1.786;
Ks=8.51;
RKs=1/beta-1+delta;
mcs=(eps_p-1)/eps_p;
X1s = 10.55;
X2s = 11.61;
Gs=0.196;
pis=1;
pistars=1;
Ps=1;
Pstars=1;
Ns=1/3;
dps=(1-theta)*(pis/pistars)^eps_p/(1- pis^eps_p*theta);
As=1;
gms=0;
us=1;
wgs=0.2;

model;

//family
//(1)
psi*exp(eta*N) = exp(w)*exp(-sigma*C);

//(2)
1/exp(sigma*C) = beta*(1/exp(sigma*C(+1))* ( exp(i)/exp(pi(+1)) ));

//(3)
gamma*exp(-1*m) = exp(-sigma*C)*((exp(i) -1)/exp(i));

//gaverment
//(4)
exp(G)=exp(wg)*exp(Y);

//(5)
wg=(1-rho_g)*omega_g+rho_g*wg(-1)+eg;

//manufacturer
//(6)
exp(Y) = exp(A)*exp(K)^alpha*exp(N)^(1-alpha);

//(7)
exp(Kstar)=exp(u)*exp(K);

//(8)
exp(w)=exp(mc)*(1-alpha)*exp(A)*exp(Kstar)^alpha*exp(N)^(-alpha);

//(9)
RK=exp(mc)*alpha*exp(Kstar)^(alpha-1)*exp(N)^(1-alpha);

//(10)
exp(K(+1))=exp(I)+(1-delta)*exp(K);

//(11)
exp(pistar)=eps_p/(eps_p -1 )*exp(pi)*exp(X1)/exp(X2);

//(12)
exp(X1) = exp(-sigma*C)*exp(Y)*exp(mc)
                +theta*beta*exp(eps_p*pi(+1))*exp(X1(+1));

//(13)
exp(X2) = exp(-sigma*C)*exp(Y) +theta*beta*exp((eps_p-1)*pi(+1))*exp(X2(+1));

//(14)
exp(mc)=exp(w)*exp(N*alpha)/((1-alpha)*exp(A)*exp(alpha*Kstar));

//(15)
exp(pi*(1-eps_p))=(1-theta)*exp(pistar*(1-eps_p))+theta;

//(16)
exp(dp)=(1-theta)*exp(-eps_p*pistar)*exp(eps_p*pi)+exp(eps_p*pi)*theta*exp(dp(-1));

//(17)
1/exp(sigma*C) = beta*(1/exp(sigma*C(+1))* ( exp(RK(+1)) + 1-delta) );

//(18)
A = rho_a*A(-1) + ea;

//(19)
exp(Y)=exp(C)+exp(I)+exp(G)+phi* (exp(I(+1) - K) - delta)^2*exp(K)/2;

//central bank
//(20)
gm = (1-rho_m)*(pis-1) - pi +rho_m*(pi(-1)) + rho_m*gm(-1) +em;  

//(21)
gm = m - m(-1);
  
end;

initval;
dp = log(dps);
w = log(ws);
i = log(is);
G = log(Gs);
Y = log(Ys);
Kstar = log(Kstars);
RK = RKs;
pistar = log(pistars);
u = log(us);
m = log(ms);
wg = log(wgs);
A = 1;
pi = log(pis);
C = log(Cs);
N = log(Ns);
K = log(Ks);
I = log(Is);
X1 = log(X1s);
X2 = log(X2s);
mc = log(mcs);
gm=0;
end;


resid;
steady;


shocks;
var ea = sigmaa^2;
var em = sigmam^2;
var eg = sigmag^2;
end;


steady;
fsolve;
check;


stoch_simul(order=1);




结果如下:
[size=13.3333px]Starting Dynare (version 6.1).Calling Dynare with arguments: noneStarting preprocessing of the model file ... Found 21 equation(s). Evaluating expressions... Computing static model derivatives (order 1). Normalizing the static model... Finding the optimal block decomposition of the static model... 10 block(s) found:   9 recursive block(s) and 1 simultaneous block(s).   the largest simultaneous block has 12 equation(s)                                  and 12 feedback variable(s). Computing dynamic model derivatives (order 1). Normalizing the dynamic model... Finding the optimal block decomposition of the dynamic model... 4 block(s) found:   3 recursive block(s) and 1 simultaneous block(s).   the largest simultaneous block has 17 equation(s)                                  and 17 feedback variable(s). Preprocessing completed. Preprocessing time: 0h00m00s.Residuals of the static equations:Equation number  1: 1  :      -5.189666Equation number  2: 2  :       0.000000Equation number  3: 3  :      -0.020190Equation number  4: 4  :      -0.000400Equation number  5: wg :      -0.904719Equation number  6: 6  :      -1.686027Equation number  7: 7  :       0.000000Equation number  8: 8  :      -3.064958Equation number  9: RK :       0.000151Equation number 10: 10 :      -0.000250Equation number 11: 11 :       0.000431Equation number 12: 12 :      -0.002377Equation number 13: 13 :      -0.001327Equation number 14: 14 :       0.574387Equation number 15: 15 :       0.000000Equation number 16: 16 :       0.000000Equation number 17: 17 :      -3.017148Equation number 18: A  :       0.500000Equation number 19: 19 :       0.000000Equation number 20: gm :       0.000000Equation number 21: 21 :       0.000000Residuals of the static equations:Equation number  1: 1  :      -5.189666Equation number  2: 2  :       0.000000Equation number  3: 3  :      -0.020190Equation number  4: 4  :      -1.003418Equation number  5: wg :       0.000000Equation number  6: 6  :       0.000488Equation number  7: 7  :       0.000000Equation number  8: 8  :       0.001432Equation number  9: RK :       0.000151Equation number 10: 10 :      -0.000250Equation number 11: 11 :       0.000431Equation number 12: 12 :      -0.002377Equation number 13: 13 :      -0.001327Equation number 14: 14 :      -0.000730Equation number 15: 15 :       0.000000Equation number 16: 16 :       0.000000Equation number 17: 17 :      -3.017148Equation number 18: A  :       0.000000Equation number 19: 19 :       0.000000Equation number 20: gm :       0.000000Equation number 21: 21 :       0.000000错误使用 print_infoImpossible to find the steady state (the sum of squared residuals of the static equations is37.0431). Either the model doesn't have a steady state, there are an infinity of steadystates, or the guess values are too far from the solution出错 steady (第 143 行)    print_info(info,options_.noprint, options_);出错 thesis2.driver (第 771 行)steady;出错 dynare (第 310 行)    evalin('base',[fname '.driver']);
[size=13.3333px]

[size=13.3333px]

[size=13.3333px]

[size=13.3333px]稳态求不出应该怎么办呀,求指点!

二维码

扫码加我 拉你入群

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

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

关键词:dynare ARE 求帮助 SIMULTANEOUS Manufacturer

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-8 08:25