楼主: bjlhello
4133 2

[问答] R语言运行OPENBUGS问题 [推广有奖]

  • 1关注
  • 0粉丝

大专生

10%

还不是VIP/贵宾

-

威望
0
论坛币
172 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
2159 点
帖子
29
精华
0
在线时间
44 小时
注册时间
2010-5-31
最后登录
2022-10-17

楼主
bjlhello 发表于 2014-8-31 17:30:47 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
我用R语言运行OPENBUGS时候无法初始化参数,
LOG里面显示unable to generate initial values for node [0F02D600H] of type GraphT.Mixing,
但是用OPENBUGS单独运行的时候就可以跑出结果,请问大牛们知道这是什么原因吗
二维码

扫码加我 拉你入群

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

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

关键词:openbugs Open BUGS bug Pen generate initial values

沙发
gssdzc 在职认证  发表于 2014-9-5 21:51:12
这个给定起来吧

藤椅
DM小菜鸟 发表于 2015-1-12 16:31:33
是不是theta用gen inits就可以了~
     
OPENBUGS的话,是这样的么——
# An example model file is given in:
model.file <- system.file(package = "R2WinBUGS", "model", "schools.txt")
# Let's take a look:
file.show(model.file)
# Some example data (see ?schools for details):
data(schools)
schools
J <- nrow(schools)
y <- schools$estimate
sigma.y <- schools$sd
data <- list ("J", "y", "sigma.y")
inits <- function(){
list(theta = rnorm(J, 0, 100), mu.theta = rnorm(1, 0, 100),
sigma.theta = runif(1, 0, 100))
}
## or alternatively something like:
# inits <- list(
# list(theta = rnorm(J, 0, 90), mu.theta = rnorm(1, 0, 90),
# sigma.theta = runif(1, 0, 90)),
# list(theta = rnorm(J, 0, 100), mu.theta = rnorm(1, 0, 100),
# sigma.theta = runif(1, 0, 100))
# list(theta = rnorm(J, 0, 110), mu.theta = rnorm(1, 0, 110),
# sigma.theta = runif(1, 0, 110)))
parameters <- c("theta", "mu.theta", "sigma.theta")
## Not run:
## both write access in the working directory and package BRugs required:
schools.sim <- bugs(data, inits, parameters, model.file,
n.chains = 3, n.iter = 5000,
program = "openbugs", working.directory = NULL)
print(schools.sim)
plot(schools.sim)
## End(Not run)


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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-31 03:10