做了好久改了好久还是有问题存在。百度了谷歌都不好用。
哪位仁兄帮帮忙。。。
MODEL:
model {
for ( i in 1:N) {
y ~ dnorm(mu, tau)
mu <- b0 + b1*log(x)
}
tau ~ dgamma(0.001, 0.001)
b0 ~ dnorm(0, 1.0E-6)
b1 ~ dnorm(0, 0.00001)
sigma <- sqrt(1/tau)
}
Code R:
path.bug <- "G:/ej52/"
path.WBs <- "C:/Program Files/WinBUGS14/"
install.packages('R2WinBUGS')
library(R2WinBUGS)
Iter <- 2000
Burn <- 1000
Thin <- 5
Chain <- 2
notes<-c(9.6,7,5,8,8.4,6.4,6.1,9.1,8.8,5.7,8.9,6.1,6.5)
sexe <-c(1,1,1,1,1,1,0,0,0,0,0,0,0)
N<- length(notes)
dades <- list(N=N, y = notes, x1 = sexe)
inicials <- list(list(tau=0.1, b0=100, b1=100),list(tau=100, b0=-100, b1=-100))
parametres <- c("b0", "b1", "sigma")
model<- bugs(dades, inicials, parameters.to.save=parametres,
model.file=paste(path.bug,"MODELsessio5.bug",sep="")
, bugs.directory=path.WBs,
n.iter=(Iter*Thin+Burn),n.burnin=Burn, n.thin=Thin, n.chains=Chain, debug=T, DIC=F
,working.directory=getwd())
print(model , digits=2)
summary(modelF)
就一直出现一样的问题
错误于bugs.run(n.burnin, bugs.directory, WINE = WINE, useWINE = useWINE, : Look at the log file andtry again with 'debug=TRUE' to figure out what went wrong within Bugs.