全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
3179 3
2014-03-17
类似这样的一个模型:y=exp(b0+b1x1+b2x2+b3x3)+e
e是标准正态分布。已有数据。
现在要用MLE估计参数。

试图用下面这串语句来解决:

program expmle
args lnf xb
qui gen double `res'=$ML_y1 - exp(`xb')
qui replace `lnf' = log(normalden(`res')
end
ml model lf expmle (y = x1 x2 x3)
ml maximize


结果提示too few variables specified。

想请教一下,是不是xb那里的变量有问题。因为我对stata的语句不熟悉,不知道怎么才能让它正常运行,求巨巨们指导啊。

二维码

扫码加我 拉你入群

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

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

全部回复
2014-3-18 01:43:48
try this one:

cap prog drop expmle
program expmle
args lnf xb sigma
qui replace `lnf' = ln(normalden($ML_y1,exp(`xb'), `sigma'))
end

ml model lf expmle (y = x1 x2 x3) /sigma
ml maximize

二维码

扫码加我 拉你入群

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

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

2014-3-18 09:47:32
jjjj6666 发表于 2014-3-18 01:43
try this one:

cap prog drop expmle
Thx. But sigma is already known as 1. Why should to estimate it? Would u explain the idea plz?
二维码

扫码加我 拉你入群

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

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

2014-3-18 20:59:38
sigma is known, but the data is sampled from the distribution, so should have sampling error by treating it as an estimate also.
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群