全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
19929 18
2010-06-20
悬赏 5 个论坛币 已解决
我在R中安装了R2WinBUGs和BRugs包,试运行了http://www.stat.columbia.edu/~gelman/bugsR/runningbugs.html
上的程序,分别报错
1,
Error in file(con, "rb") : 无法打开链结
此外: 警告信息:
In file(con, "rb") :
  无法打开文件'c:/Program Files/WinBUGS14//System/Rsrc/Registry.odc': No such file or directory
错误于bugs.run(n.burnin, bugs.directory, WINE = WINE, useWINE = useWINE,  :
  WinBUGS executable does not exist in c:/Program Files/WinBUGS14/
此外: 警告信息:
In list.files(bugs.directory) :
  list.files: 'c:/Program Files/WinBUGS14/'目录不可读


2,
Carriage returns added to model file schools.bug
invalid or unexpected token scanned error pos 106 (error on line 10)
model must be checked before data is loaded
错误于samplesSetLastChain(numChains) :
  it is required to have 1 <= last <= nchains
此外: 警告信息:
In readChar(modelFile, 10^3) : 在non-UTF-8 MBCS语言环境里只能读取字节

3,错误于bugs.run(n.burnin, bugs.directory, WINE = WINE, useWINE = useWINE,  :
  Look at the log file and
try again with 'debug=TRUE' to figure out what went wrong within Bugs
.

问题1。是我把WinBUGS和OpenBugs都装在了D盘,除了重装,有没有什么解决办法?
2。如何修改下载的这程序包里的源程序?
3。以上报错的解决办法?
4。运行中WinBUGS程序快速闪过,看不清内容,如何处理?
刚刚接触R,望高手不吝赐教!

最佳答案

soccy 查看完整内容

如果使用R2WinBUGS包的话,两个主要functions: bugs和openbugs都有“bugs.directory=”这个选项。如果你的bugs在d盘,可以用bugs(..., bugs.directory="d:/Program Files/WinBUGS14/",...)。试试看。
二维码

扫码加我 拉你入群

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

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

全部回复
2010-6-20 02:43:25
如果使用R2WinBUGS包的话,两个主要functions: bugs和openbugs都有“bugs.directory=”这个选项。如果你的bugs在d盘,可以用bugs(..., bugs.directory="d:/Program Files/WinBUGS14/",...)。试试看。
二维码

扫码加我 拉你入群

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

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

2010-6-23 17:32:28
我的回答帮助你解决问题了吗?
二维码

扫码加我 拉你入群

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

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

2010-6-23 18:41:33
soccy 发表于 2010-6-20 06:28
如果使用R2WinBUGS包的话,两个主要functions: bugs和openbugs都有“bugs.directory=”这个选项。如果你的bugs在d盘,可以用bugs(..., bugs.directory="d:/Program Files/WinBUGS14/",...)。试试看。
十分十分感谢您的答复,对不起,是我对您的答复,回复的慢了,本来我还想还有没有别人能给出什么结果的,呵呵。。
今天我又花点时间看怎么在MATLAB在调用winBUGS或者OpenBUGS来着,也是出了一堆问题,问题在这里http://www.pinggu.org/bbs/thread-841095-1-1.html

我按照您的方法,在命令里加入了bugs.directory="d:/Program Files/WinBUGS14/",结果提示:
错误于bugs.run(n.burnin, bugs.directory, WINE = WINE, useWINE = useWINE,  :
  Look at the log file and
try again with 'debug=TRUE' to figure out what went wrong within Bugs.


总之十分感谢您。
二维码

扫码加我 拉你入群

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

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

2010-6-23 19:29:33
另外我得到的log文件如下,我用的是网上给的例子,怎么check model还会有错呢?
check(C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/RtmpKs0B7c/schools.bug.txt)
invalid or unexpected token scanned
data(C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/RtmpKs0B7c/data.txt)
command #Bugs:data cannot be executed (is greyed out)
compile(3)
inits(1,C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/RtmpKs0B7c/inits1.txt)
command #Bugs:inits cannot be executed (is greyed out)
inits(2,C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/RtmpKs0B7c/inits2.txt)
command #Bugs:inits cannot be executed (is greyed out)
inits(3,C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/RtmpKs0B7c/inits3.txt)
command #Bugs:inits cannot be executed (is greyed out)
gen.inits()
command #Bugs:gen.inits cannot be executed (is greyed out)
thin.updater(1)
update(500)
command #Bugs:update cannot be executed (is greyed out)
set(theta)
command #Bugs:set cannot be executed (is greyed out)
set(mu.theta)
command #Bugs:set cannot be executed (is greyed out)
set(sigma.theta)
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(500)
command #Bugs:update cannot be executed (is greyed out)
coda(*,C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/RtmpKs0B7c/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:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/RtmpKs0B7c/history.odc)
command #Bugs:history cannot be executed (is greyed out)
save(C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/RtmpKs0B7c/log.odc)
save(C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/RtmpKs0B7c/log.txt)
二维码

扫码加我 拉你入群

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

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

2010-6-23 20:38:50
由于Matlab不是自由软件,我很少接触。我个人认为BUGS/JAGS与R的组合是比较理想的Bayesian分析平台(而且学习材料比较多)。
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群