楼主: 小面瓜
20954 18

[资料] 请问用eviews如何进行最大似然估计.   [推广有奖]

11
qiuchh2004 发表于 2005-4-14 11:38:00

没用,很容易出现问题,总是出missing value 或别的问题我已经研究好几天了,最后还是决定放弃。也没有别人会,在周围人中。郁闷

12
qiuchh2004 发表于 2005-4-14 11:41:00

请教用STATA怎么做最大似然估计

13
蓝色 发表于 2005-4-14 11:58:00

stata里面最ML比较麻烦,不如sas。

下面是一个例子,

capture clear

set more 1 ******************the CES production functions ************* program define nlces if "`1'" == "?" { global S_1 "B0 A D R" global B0 = 1 global A =1 global D =0.3 global R =0.7 exit } replace `1' =$B0+$A*ln($D*labor^$R+(1-$D)*capital^$R) end

use d:\data\dta\ces.dta nl ces lnq

*quietly nl ces lnq

*set more 0

/* NL */

program define nlnexpgr if "`1'" == "?" { /* if query call ... */ global S_1 "B0 B1" /* declare parameters */ global B0=1 /* and initialize them */ global B1=.1 exit } replace `1'=$B0*(1-exp(-$B1*x)) /* otherwise, calculate function */ end

*use sasxmpl1, clear gen y=products gen x=labor nl nexpgr y

/* mL */ program define mlnexpgr version 7 args lnf B1x B0 sigma tempvar res qui gen double `res' = $ML_y1 - `B0'*(1-exp(-`B1x')) qui replace `lnf' = -0.5*ln(2*_pi)-ln(`sigma')-0.5*`res'^2/`sigma'^2 end

ml model lf mlnexpgr (B1: y = x, nocons) (B0:) (sigma:)

ml check ml search ml max

ml model lf mlnexpgr (B1: y = x, nocons) (B0:) (sigma:), robust ml check ml search ml max

*ml model lf mlnexpgr (B1: y = x, nocons) (B0:) (sigma:), cluster(group) *ml max

14
kiven 发表于 2005-4-14 13:26:00
Eviews里面可以做,可以在帮助文件里面看到。就是要注意开始的时候就要定义待估计参数,否则系统会提示出错。

15
qiuchh2004 发表于 2005-4-14 18:08:00

还是不行,系统提示总是说missing value 知道那里不对。我就是按照帮助文件做的。说明是

@logl logl1

res=z-c(1)-c(2)*x1-------------c(21)*x55

var=c(22)

logl1=-log(2*3.14158*var)/2-log(res^2)/2*var

不知道为什么不行

16
pkulidefa 发表于 2006-4-28 18:47:00

你不够天才,呵呵,开玩笑

17
Linda孙 发表于 2009-4-14 08:25:00
glxy.dhu.edu.cn/xnktt/精品课程/mysite2/download/Eviews/Eviews操作手册.doc 第十八章

18
yangnanyn 发表于 2011-6-11 09:37:28
楼主关于这个missing value的问题解决了吗,我的也遇到这样的问题了

19
迷迷匣子 发表于 2013-4-14 10:00:01
很简单,估计方法里,选择 censored data 就行了

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-27 03:03