首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从R调用WinBUGS14

从R调用WinBUGS14
EN

Stack Overflow用户
提问于 2012-03-25 08:57:29
回答 1查看 1.3K关注 0票数 2

我正试着从R给WinBUGS打电话,但一直不太成功。

我在R中输入了以下代码:

代码语言:javascript
复制
radon.data <- list ("n", "J", "x", "y", "county")
radon.inits <- function (){
  list (a=rnorm(J), b=rnorm(1), mu.a=rnorm(1),
        sigma.y=runif(1), sigma.a=runif(1))
}
radon.parameters <- c ("a", "b", "mu.a", "sigma.y", "sigma.a")

然后,我调用WinBUGS:

代码语言:javascript
复制
radon.bugs.1 <- bugs (radon.data, radon.inits, radon.parameters, "radon.1.bug", n.iter=10,
        bugs.directory="C:/Program Files/WinBUGS14", working.directory=NULL, clearWD=TRUE, debug=TRUE )

我在WinBUGS中得到了以下错误:

代码语言:javascript
复制
set(sigma.y)
command #Bugs:set cannot be executed (is greyed out)
set(sigma.a)
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(5)
command #Bugs:update cannot be executed (is greyed out)
coda(*,C:/Users/Gabriel/AppData/Local/Temp/Rtmpf1rAQa/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/Gabriel/AppData/Local/Temp/Rtmpf1rAQa/history.odc)
command #Bugs:history cannot be executed (is greyed out)
save(C:/Users/Gabriel/AppData/Local/Temp/Rtmpf1rAQa/log.odc)
save(C:/Users/Gabriel/AppData/Local/Temp/Rtmpf1rAQa/log.txt)

如果有人能帮我,我将不胜感激。我的文件都在同一个文件里

EN

回答 1

Stack Overflow用户

发布于 2012-06-04 20:17:47

当您的bug尚未编译时,会出现这些错误消息。首先尝试在WinBUGS中工作,直到可以启动并运行模型。然后保存

代码语言:javascript
复制
model{
    ....
    bayesian model
    ....
}

零件作为.bug文件。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9857062

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档