楼主: rantao
2067 9

[编程问题求助] 请教一个mle的bootstrap问题 [推广有奖]

  • 0关注
  • 0粉丝

本科生

46%

还不是VIP/贵宾

-

威望
0
论坛币
49 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
1133 点
帖子
33
精华
0
在线时间
150 小时
注册时间
2008-8-4
最后登录
2020-5-28

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
小弟想estimate一个mle估计出来的coefficient的standard error,用bootstrap方法。我做了这两个do files:
1、
program tmle_lf
args lnf xb n
qui replace `lnf' = log(tden(`n',$ML_y1 - `xb'))
end
2、
program  mymle
        syntax varlist
        gettoken dep indep: varlist
        ml model lf tmle_lf (`dep'=`indep')
        ml max
end

然后用bootstrap命令:
bootstrap _b _se, reps(500) size(5000) : mymle y x1 x2 x3

结果报错:invalid syntax
an error occurred when bootstrap executed mymle


请教这是什么啊,应该怎样修改呢?
二维码

扫码加我 拉你入群

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

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

关键词:Bootstrap Bootstra boots boot Trap

沙发
kerrydu 发表于 2014-4-5 13:49:29 |只看作者 |坛友微信交流群
i make a mistake

使用道具

藤椅
rantao 发表于 2014-4-5 16:18:55 |只看作者 |坛友微信交流群
kerrydu 发表于 2014-4-5 13:49
i make a mistake
????????

使用道具

板凳
luisluan 发表于 2014-4-5 18:39:34 |只看作者 |坛友微信交流群
似然函数写错了,你写的`n',$ML_y1 - `xb'分别应该是自由度和t,这么计算有问题的,总不能回归时人为写自由度吧,并且y-xb直接就是t统计量好像也欠妥。
得从最基本的似然函数找原因,你自己试试这个似然估计量随便估计一个数据不报错么?不用bootstrap

使用道具

报纸
rantao 发表于 2014-4-5 20:36:12 |只看作者 |坛友微信交流群
luisluan 发表于 2014-4-5 18:39
似然函数写错了,你写的`n',$ML_y1 - `xb'分别应该是自由度和t,这么计算有问题的,总不能回归时人为写自由 ...
那个是没问题的。可以直接做mle。
它是回归方程的standard error服从t分布。

使用道具

地板
kerrydu 发表于 2014-4-5 21:27:30 |只看作者 |坛友微信交流群
ml model lf tmle_lf (`dep'=`indep') ()

使用道具

7
jjjj6666 发表于 2014-4-5 22:36:41 |只看作者 |坛友微信交流群
I think u can do that if assuming residual as t, because you have two arguments, you need to change the part of your code to:

ml model lf tmle_lf (`dep'=`indep') /n

or

ml model lf tmle_lf (`dep'=`indep') ()

使用道具

8
rantao 发表于 2014-4-6 10:54:55 |只看作者 |坛友微信交流群
jjjj6666 发表于 2014-4-5 22:36
I think u can do that if assuming residual as t, because you have two arguments, you need to change  ...
not work.....

Is there any thing wrong in the 2nd program?

Thank u!

使用道具

9
luisluan 发表于 2014-4-6 11:07:34 |只看作者 |坛友微信交流群
rantao 发表于 2014-4-5 20:36
那个是没问题的。可以直接做mle。
它是回归方程的standard error服从t分布。
你试过么?服从什么分布这个事倒不是影响你模型能不能运行的问题,但影响是否收敛。
直接作连ml check都过不去

使用道具

10
jjjj6666 发表于 2014-4-6 21:39:39 |只看作者 |坛友微信交流群
rantao 发表于 2014-4-6 10:54
not work.....

Is there any thing wrong in the 2nd program?
not working, do you mean the program is working, but mle not converging, or something else?  the 2nd program should be:

program  mymle
        syntax varlist
        gettoken dep indep: varlist
        ml model lf tmle_lf (`dep'=`indep') /n
        ml max
end

使用道具

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

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-28 12:02