全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 winbugs及其他软件专版
3029 5
2014-06-16
I am estimating a stochastic frontier with a mixed model. So far the half normal distribution worked good but I need a truncated normal distribution. It does not work, and I receive the error „Expected collection operator c“. I am using R2WinBUGS and as you can see in the model I have tried OpenBUGS and WinBUGS. Any suggestion? My model looks like:

for (i in 1:N)
{

    mu <- alpha + x[i,1]*beta[1] + x[i,2]*beta[2] + x[i,3]*beta[3] +
         x[i,4]*beta[4] + x[i,5]*beta[5] + u0[county] + u1[county]*x[i,1] +
         u2[county]*x[i,2] + u3[county]*x[i,3] + u4[county]*x[i,4] +
         u5[county]*x[i,5] - z[ID]

    y ~ dnorm(mu, tau)

}

for (i in 1:220) {
    z ~ djl.dnorm.trunc(rho,lambda,0,1000)

    z ~ dnorm(rho,lambda)T(0,100)  #For openbugs

    eff <- exp(-z)
}
prior for rho~dnorm(0,0.027)

I would appreciate your help! Regards
二维码

扫码加我 拉你入群

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

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

全部回复
2014-6-16 02:13:15
Openbugs (so I would assume the same in winbugs, but could be wrong) you can do a truncated distribution using the T function, something like:

y[i] ~ dnorm(x[i],tau)T(0,10)
二维码

扫码加我 拉你入群

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

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

2014-6-16 02:13:53
Unlike OpenBUGS, WinBUGS doesn't provide the T() operation
二维码

扫码加我 拉你入群

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

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

2014-6-16 02:14:45
Actually, WinBUGS has I() which is a censoring and truncation function. WinBUGS manual page 12.mrc-bsu.cam.ac.uk/bugs/winbugs/manual14.pdf
二维码

扫码加我 拉你入群

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

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

2014-6-16 02:15:55
According to http://www.unc.edu/courses/2010fall/ecol/563/001/docs/solutions/assign10.htm, two gotchas that may apply are that

the upper truncation point may need to be adjusted (e.g., from 10 to 10.0001)
initial values that seed the chains need to be specified explicitly, because WinBUGS may pick ones that lie outside of (α,β).
二维码

扫码加我 拉你入群

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

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

2017-10-8 16:35:08
what is skew-normal distribution?
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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