楼主: aliocean
11092 20

[DSGE讨论专题] DSGE模型在dynare中运行问题求助,急! [推广有奖]

  • 0关注
  • 0粉丝

大专生

35%

还不是VIP/贵宾

-

威望
0
论坛币
23 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
327 点
帖子
52
精华
0
在线时间
45 小时
注册时间
2008-7-9
最后登录
2018-4-14

楼主
aliocean 发表于 2014-3-29 16:20:16 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
建了个垄断竞争的模型,放在dynare中运行了一下,结果如下。菜鸟一枚,求大神指点迷津,这是说明什么问题呢?
STEADY:  The Jacobian contains Inf or NaN. The problem arises from:

STEADY:  Derivative of Equation 1 with respect to Variable c  (initial value of c: 0)
STEADY:  Derivative of Equation 2 with respect to Variable n  (initial value of n: 0)
STEADY:  Derivative of Equation 2 with respect to Variable W  (initial value of W: 0)
STEADY:  Derivative of Equation 7 with respect to Variable W  (initial value of W: 0)
STEADY:  Derivative of Equation 2 with respect to Variable P  (initial value of P: 0)
STEADY:  Derivative of Equation 3 with respect to Variable P  (initial value of P: 0)
STEADY:  Derivative of Equation 4 with respect to Variable P  (initial value of P: 0)
STEADY:  Derivative of Equation 7 with respect to Variable P  (initial value of P: 0)
STEADY:  Derivative of Equation 8 with respect to Variable P  (initial value of P: 0)
STEADY:  Derivative of Equation 9 with respect to Variable P  (initial value of P: 0)
STEADY:  Derivative of Equation 3 with respect to Variable M  (initial value of M: 0)
STEADY:  Derivative of Equation 18 with respect to Variable M  (initial value of M: 0)
STEADY:  Derivative of Equation 3 with respect to Variable pi  (initial value of pi: 0)
STEADY:  Derivative of Equation 10 with respect to Variable pi  (initial value of pi: 0)
STEADY:  Derivative of Equation 13 with respect to Variable pi  (initial value of pi: 0)
STEADY:  Derivative of Equation 6 with respect to Variable K  (initial value of K: 0)
STEADY:  Derivative of Equation 7 with respect to Variable A  (initial value of A: 0)
STEADY:  Derivative of Equation 16 with respect to Variable A  (initial value of A: 0)
STEADY:  Derivative of Equation 8 with respect to Variable MC  (initial value of MC: 0)
STEADY:  Derivative of Equation 9 with respect to Variable MC  (initial value of MC: 0)
STEADY:  Derivative of Equation 10 with respect to Variable MC  (initial value of MC: 0)
STEADY:  Derivative of Equation 8 with respect to Variable y  (initial value of y: 0)
STEADY:  Derivative of Equation 9 with respect to Variable y  (initial value of y: 0)
STEADY:  Derivative of Equation 10 with respect to Variable y  (initial value of y: 0)
STEADY:  Derivative of Equation 13 with respect to Variable y  (initial value of y: 0)
STEADY:  Derivative of Equation 17 with respect to Variable g  (initial value of g: 0)
STEADY:  Derivative of Equation 2 with respect to Variable lam  (initial value of lam: 0)
STEADY:  Derivative of Equation 3 with respect to Variable lam  (initial value of lam: 0)
STEADY:  Derivative of Equation 4 with respect to Variable lam  (initial value of lam: 0)
STEADY:  Derivative of Equation 4 with respect to Variable q  (initial value of q: 0)
STEADY:  Derivative of Equation 4 with respect to Variable Z  (initial value of Z: 0)
STEADY:  Derivative of Equation 7 with respect to Variable Z  (initial value of Z: 0)
STEADY:  Derivative of Equation 1 with respect to Variable z  (initial value of z: 0)
STEADY:  Derivative of Equation 14 with respect to Variable z  (initial value of z: 0)
STEADY:  Derivative of Equation 15 with respect to Variable x  (initial value of x: 0)

STEADY:  The problem most often occurs, because a variable with
STEADY:  exponent smaller than 1 has been initialized to 0. Taking the derivative
STEADY:  and evaluating it at the steady state then results in a division by 0.
Error using dynare_solve (line 60)
An element of the Jacobian is not finite or NaN

二维码

扫码加我 拉你入群

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

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

关键词:dsge模型 dynare 运行问题 DSGE ARE initial problem respect arises 模型

沙发
yuanxinqiang 发表于 2014-3-29 19:01:17
已经提示的很清楚了,除0错误,导数不存在。

藤椅
aliocean 发表于 2014-3-29 21:37:13
yuanxinqiang 发表于 2014-3-29 19:01
已经提示的很清楚了,除0错误,导数不存在。
谢谢,可就是线性化的模型呀,这种问题如何解决呢?本人小白,请您不吝赐教

板凳
aliocean 发表于 2014-3-29 21:47:08
yuanxinqiang 发表于 2014-3-29 19:01
已经提示的很清楚了,除0错误,导数不存在。
我后来运行了一下手册中的程序(第五章:5.8, p54),可还是有如下问题,这是怎么回事呢?

You did not declare endogenous variables after the estimation/calib_smoother command.

报纸
yuanxinqiang 发表于 2014-3-29 22:26:49
没有声明内生变量
用关键词var声明

地板
aliocean 发表于 2014-3-30 09:45:08
yuanxinqiang 发表于 2014-3-29 22:26
没有声明内生变量
用关键词var声明
我声明了呀,程序如下,能不能帮我看下有什么问题,谢谢
var y c k i l yl w r z;
varexo e;
parameters beta psi delta alpha rho epsilon;
model;
(1/c) = beta*(1/c(+1))*(1+r(+1)-delta);
psi*c/(1-l) = w;
c+i = y;
y = (k(-1)^alpha)*(exp(z)*l)^(1-alpha);
w = y*((epsilon-1)/epsilon)*(1-alpha)/l;
r = y*((epsilon-1)/epsilon)*alpha/k(-1);
i = k-(1-delta)*k(-1);
yl = y/l;
z = rho*z(-1)+e;
end;
varobs y i;
initval;
k = 9;
c = 0.76;
l = 0.3;
w = 2.07;
r = 0.03;
z = 0;
e = 0;
end;
estimated_params;
alpha,beta_pdf,0.35,0.02;
beta,beta_pdf,0.99,0.002;
delta,beta_pdf,0.025,0.003;
psi,gamma_pdf,1.75,0.1;
rho,beta_pdf,0.95,0.05;
epsilon,gamma_pdf,10,0.5;
stderr e,inv_gamma_pdf,0.01,inf;
end;
estimation(datafile=biyelunwen,nobs=200,mh_replic=2000,mh_nblocks=2,mh_drop=0.45,mh_jscale=0.8,
mode_compute=4)y i;

7
aliocean 发表于 2014-3-30 10:10:39
yuanxinqiang 发表于 2014-3-29 22:26
没有声明内生变量
用关键词var声明
我刚刚把观测变量减为一个y,程序就运行出来了,因为手册里看到冲击的个数不能少于观测变量的个数。
parameters
        prior mean   post. mean        90% HPD interval    prior       pstdev

alpha        0.350       0.3540      0.3255      0.3862   beta        0.0200
beta         0.990       0.9900      0.9866      0.9933   beta        0.0020
delta        0.025       0.0257      0.0209      0.0311   beta        0.0030
psi          1.750       1.7385      1.5484      1.8698   gamma       0.1000
rho          0.950       0.9914      0.9817      0.9998   beta        0.0500
epsilon       10.000      10.0123      9.1798     10.7565   gamma       0.5000

standard deviation of shocks
        prior mean   post. mean        90% HPD interval    prior       pstdev

e            0.010       0.0307      0.0234      0.0382   invg           Inf

8
yuanxinqiang 发表于 2014-3-30 10:13:25
aliocean 发表于 2014-3-30 10:10
我刚刚把观测变量减为一个y,程序就运行出来了,因为手册里看到冲击的个数不能少于观测变量的个数。
par ...
[em17]

9
aliocean 发表于 2014-3-30 11:28:31
yuanxinqiang 发表于 2014-3-30 10:13
我把别人的模型运行出来了,可自己的还停留在原始问题上,想问一下“导数不存在”怎么办?

10
yuanxinqiang 发表于 2014-3-30 11:33:19
aliocean 发表于 2014-3-30 11:28
我把别人的模型运行出来了,可自己的还停留在原始问题上,想问一下“导数不存在”怎么办?
要不你的模型有问题

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

本版微信群
扫码
拉您进交流群
GMT+8, 2026-2-3 01:55