楼主: ReneeBK
3091 5

[精彩WinBUGS答问]WinBUGS truncated normal distribution [推广有奖]

  • 1关注
  • 62粉丝

VIP

已卖:4900份资源

学术权威

14%

还不是VIP/贵宾

-

TA的文库  其他...

R资源总汇

Panel Data Analysis

Experimental Design

威望
1
论坛币
49655 个
通用积分
55.9937
学术水平
370 点
热心指数
273 点
信用等级
335 点
经验
57805 点
帖子
4005
精华
21
在线时间
582 小时
注册时间
2005-5-8
最后登录
2023-11-26

楼主
ReneeBK 发表于 2014-6-16 02:07:17 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
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
二维码

扫码加我 拉你入群

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

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

关键词:distribution truncated winbugs WINBUG normal collection receive normal error

沙发
ReneeBK 发表于 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)

藤椅
ReneeBK 发表于 2014-6-16 02:13:53
Unlike OpenBUGS, WinBUGS doesn't provide the T() operation

板凳
ReneeBK 发表于 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

报纸
ReneeBK 发表于 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?

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-24 20:57