楼主: Lisrelchen
1806 1

[精彩WinBUGS答问]Estimation of the shape parameter of gamma distribution [推广有奖]

  • 0关注
  • 62粉丝

VIP

已卖:4194份资源

院士

67%

还不是VIP/贵宾

-

TA的文库  其他...

Bayesian NewOccidental

Spatial Data Analysis

东西方数据挖掘

威望
0
论坛币
50288 个
通用积分
83.6306
学术水平
253 点
热心指数
300 点
信用等级
208 点
经验
41518 点
帖子
3256
精华
14
在线时间
766 小时
注册时间
2006-5-4
最后登录
2022-11-6

楼主
Lisrelchen 发表于 2014-6-16 12:54:42 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
I want to estimate the shape parameter of gamma distribution in Winbugs. I select gamma distribution as prior for shape parameter. Data set is generated using MATLAB as:

gamrnd(5,1,[100 1])
a small part of data loaded to model is here:

list(n=100,b=1)
y[,1]
9.85509822926424
6.78794280129914
2.37341388433267
5.44664020179438
14.7723695566505
4.53177357981821
.
.
END
The model in Winbugs is simple and as follows:

model;
{
   for( i in 1 : n ) {
      y ~ dgamma(a,b)
   }
   a ~ dgamma(3,1)
}
Estimation is strongly dependent on the prior that was selected for a. As for each distribution, (normal-gamma-uniform) the estimated a value is around the mean value of the selected prior distribution. For example, choosing the above-mentioned prior (a ~ dgamma(3,1)) resulted in shape parameter estimation 3.026; also running the model for more iterations doesn't change results so much!

What is the problem and how can I solve that?

二维码

扫码加我 拉你入群

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

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

关键词:distribution Estimation Parameter paramete winbugs

沙发
Lisrelchen 发表于 2014-6-16 12:56:08
I run a similar script in R, but it seems that OK, setting prior of the b

How is your prior of b setting?

Has your MCMC chain already converged?

PS: I tried something as below as you set b as fixed. But I also tried some other prior of b, it is OK.

N <- 100
x <- rgamma(N, 5, 1)


write("
model {
    for (i in 1:length(x)) {
        x[i] ~ dgamma(a, b)
    }
    a ~ dgamma(3, 1)
    b <- 1
}",
file="example1.bug")

jags <- jags.model('example1.bug',
                   data = list('x' = x),
                   n.chains = 4,
                   n.adapt = 100)


mcmc.samples <- coda.samples(jags,
             c('a', "b"),
             n.iter = 10000)

summary(mcmc.samples)  

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

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