如何matlab中用winbugs
答案:2 悬赏:40
解决时间 2021-02-10 12:46
- 提问者网友:践踏俘获
- 2021-02-09 21:51
如何matlab中用winbugs
最佳答案
- 二级知识专家网友:旧事诱惑
- 2021-02-09 22:21
语法及Prior distributions有错的地方,
都已帮你更正.
A2=0,表示有误,请自行更改.
运行结果如下:
Inference for Bugs model at "rabbit.bug", fit using WinBUGS,
1 chains, each with 13000 iterations (first 3000 discarded)
n.sims = 10000 iterations saved
mean sd 2.5% 25% 50% 75% 97.5%
a 1.001 0.001 1.000 1.000 1.000 1.001 1.002
b 4.979 0.021 4.924 4.971 4.985 4.994 5.000
p 4.976 0.025 4.911 4.966 4.983 4.993 4.999
q 3.002 0.002 3.000 3.001 3.002 3.003 3.008
k 1.002 0.002 1.000 1.001 1.001 1.003 1.007
logl -1876.811 2.236 -1882.000 -1878.000 -1876.000 -1875.000 -1873.000
A2 0.000 0.000 0.000 0.000 0.000 0.000 0.000
deviance 5227.280 4.458 5221.000 5224.000 5227.000 5230.000 5238.000
DIC info (using the rule, pD = Dbar-Dhat)
pD = 0.0 and DIC = 5227.3
DIC is an estimate of expected predictive error (lower deviance is better).
Ps:
Prior distributions dunif()
的范围请自行更改决定
以上仅供参考
rabbit.bug
都已帮你更正.
A2=0,表示有误,请自行更改.
运行结果如下:
Inference for Bugs model at "rabbit.bug", fit using WinBUGS,
1 chains, each with 13000 iterations (first 3000 discarded)
n.sims = 10000 iterations saved
mean sd 2.5% 25% 50% 75% 97.5%
a 1.001 0.001 1.000 1.000 1.000 1.001 1.002
b 4.979 0.021 4.924 4.971 4.985 4.994 5.000
p 4.976 0.025 4.911 4.966 4.983 4.993 4.999
q 3.002 0.002 3.000 3.001 3.002 3.003 3.008
k 1.002 0.002 1.000 1.001 1.001 1.003 1.007
logl -1876.811 2.236 -1882.000 -1878.000 -1876.000 -1875.000 -1873.000
A2 0.000 0.000 0.000 0.000 0.000 0.000 0.000
deviance 5227.280 4.458 5221.000 5224.000 5227.000 5230.000 5238.000
DIC info (using the rule, pD = Dbar-Dhat)
pD = 0.0 and DIC = 5227.3
DIC is an estimate of expected predictive error (lower deviance is better).
Ps:
Prior distributions dunif()
的范围请自行更改决定
以上仅供参考
rabbit.bug
全部回答
- 1楼网友:我叫很个性
- 2021-02-09 23:05
以下例子有如何用r调用winbugs,如果是openbugs需要加载另外一个包
> # r code with interface to winbugs
>
> library(r2winbugs)
> y<-read.table("d:/bugs/jump.dat",header=true) #import data#
> n<-length(y)
> xi0<-rep(0,n) # give initial values to state variables#
> j0<-rep(0,n)
> data<-list("n","y")
> # give initial values to the parameters for winbugs #
> inits <-function() {list ( tau=2,
+ jtau=2,
+ mu=0,
+ jmu=0,
+ lamda = 0.05, xi=xi0,j=j0)}
> parameters<- c("sigma","jsigma","mu","jmu","lamda","xi","j")
> # quote the winbugs#
> jump.sim<-bugs (data, inits=inits, parameters, "model.bug", n.chains=3, n.iter=1000,debug=true,
+ dic=true,bugs.directory = "d:/program files/winbugs14/",working.directory = "d:/bugs")
错误于is.finite(x) : 没有为'list'类型实现默认的方法
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯