楼主: ReneeBK
1386 1

[精彩WinBUGS答问]How does “thin” setting affect the number of samples [推广有奖]

  • 1关注
  • 62粉丝

VIP

已卖:4898份资源

学术权威

14%

还不是VIP/贵宾

-

TA的文库  其他...

R资源总汇

Panel Data Analysis

Experimental Design

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

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

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
I do not understander how "thin" setting affects the number of samples in WinBUGS. Here is my case:

Case 1: In Model -->  Update... -> Update Tool, I set updates 5000,  refresh 100, thin 1, click update. In Inference -> Samples...-> sample is 4500 in stats

Case 2: In Model -->  Update... -> Update Tool, I set updates 5000,  refresh 100, thin 2, click update. In Inference -> Samples...-> sample is 4750 in stats

Case 3: In Model -->  Update... -> Update Tool, I set updates 5000,  refresh 100, thin 5, click update. In Inference -> Samples...-> sample is 4900 in stats

Case 4: In Model -->  Update... -> Update Tool, I set updates 5000,  refresh 100, thin 10, click update. In Inference -> Samples...-> sample is 4950 in stats

Based on WinBUGS User Manual, thin is the samples from every kth iteration will be stored, where k is the value of thin. Setting k > 1 can help to reduce the autocorrelation in the sample, but there is no real advantage in thinning except to reduce storage requirements and the cost of handling the simulations when very long runs are being carried out.

My questions are

In Case 1, why sample is 4500 not 5000?
How does the "thin" setting affect the sample size in Node Statistics?
The following is my code.

model {
for(i in 1: N) {
CF01 ~ dnorm(0, 20)
CF02  ~ dnorm(0, 1)
h ~ dpois (lambda )
log(lambda ) <- beta0 + beta1*CF03 + beta2*CF02 + beta3*CF01 + beta4*IND
}
beta0 ~ dnorm(0.0, 1.0E-6)
beta1 ~ dnorm(0.0, 1.0E-6)
beta2 ~ dnorm(0.0, 1.0E-6)
beta3 ~ dnorm(0.0, 1.0E-6)
beta4  <- log(p)
p ~ dunif(lower, upper)
}

INITS
list(beta0 = 0, beta1 = 0, beta2 = 0, beta3 = 0, p = 0.9)

DATA(LIST)
list(N = 15, lower = 0.80, upper = 0.95,

h = c(1,4,1,2,1,2,1,1,1,3,3,0,0,0,NA),

CF03 = c(-1.5,0.1,1.0,0.1,-0.7,0.6,0.2,
0.1,-0.3,1.9,-1.5,0.2,1.0,-0.3,0.8),

CF02 = c(NA,NA,0.3,0.1,-0.9,-0.1,-0.2,-0.7,
-0.9,2.3,1.4,1.2,1.2,-0.7,-1.5),

CF01 = c(NA,NA,NA,-0.1,-0.2,-0.3,-0.2,-0.2,-0.2,
-0.1,0.1,-0.2,-0.2,-0.1,0.1),

IND = c(1,1,0,0,0,0,0,0,0,0,0,0,0,0,0))
二维码

扫码加我 拉你入群

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

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

关键词:winbugs setting samples Sample Number setting number affect update

沙发
ReneeBK 发表于 2014-6-16 02:04:28
Let N be the number of updates, T be the 1 / the thin rate (e.g., 10 = return 1 out of every 10 samples), B be the number of burnin samples, and S be the number of returned samples.

The number of burnin samples defaults to 0.1N. The total number of samples is the number of updates divided by the thin rate, NT. We then subtract off the burnin samples to get the number of (unthinned) samples NT−B, and multiply by the thin rate to get the number of samples actually returned.

Thus B=0.1N and S=(NT−B)/T.

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

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