问题描述
我使用 R 包 R2WinBUGS 来运行带有 R 的 Winbugs。如果我的数据不是太大,它会起作用,但是当我尝试将一个值从 2700 更改为 2750 时它不起作用(这个增量是完全可能的)。
我使用模型的代码:
sims <- bugs(data_list,inits = NULL,model.file = "Prev.bug",parameters = c("ap"),n.chains = 3,n.iter = 1000,bugs.directory = "winbugs14/",debug=TRUE)
我的模型是:
model
{
y ~ dbin(ap,n)
ap <- Se*PT+(1-Sp)*(1-PT)
z ~ dbern(0.05)
Se ~ dbeta(55,13)
Sp ~ dbeta(500,15)
tpa ~ dbeta(1,1)
PT <- z*tpa
a <- equals(PT,0)
}
适用于
data_list <- list(
y = 32,n = 2700)
但它没有
data_list <- list(
y = 32,n = 2750)
错误信息:
display(log)
check(C:/Users/GGCRL1~1/AppData/Local/Temp/RtmpuvZS2x/Prev.bug.txt)
model is syntactically correct
data(C:/Users/GGCRL1~1/AppData/Local/Temp/RtmpuvZS2x/data.txt)
data loaded
compile(3)
model compiled
inits(1,C:/Users/GGCRL1~1/AppData/Local/Temp/RtmpuvZS2x/inits1.txt)
expected a number or an NA
inits(2,C:/Users/GGCRL1~1/AppData/Local/Temp/RtmpuvZS2x/inits2.txt)
inits(3,C:/Users/GGCRL1~1/AppData/Local/Temp/RtmpuvZS2x/inits3.txt)
gen.inits()
value of bernoulli z must be an integer
thin.updater(15)
update(334)
command #Bugs:update cannot be executed (is greyed out)
set(ap)
command #Bugs:set cannot be executed (is greyed out)
set(deviance)
command #Bugs:set cannot be executed (is greyed out)
dic.set()
command #Bugs:dic.set cannot be executed (is greyed out)
update(334)
command #Bugs:update cannot be executed (is greyed out)
coda(*,C:/Users/GGCRL1~1/AppData/Local/Temp/RtmpuvZS2x/coda)
command #Bugs:coda cannot be executed (is greyed out)
stats(*)
command #Bugs:stats cannot be executed (is greyed out)
dic.stats()
DIC
history(*,C:/Users/GGCRL1~1/AppData/Local/Temp/RtmpuvZS2x/history.odc)
command #Bugs:history cannot be executed (is greyed out)
save(C:/Users/GGCRL1~1/AppData/Local/Temp/RtmpuvZS2x/log.odc)
save(C:/Users/GGCRL1~1/AppData/Local/Temp/RtmpuvZS2x/log.txt)
你能帮我吗?任何建议将不胜感激。非常感谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)