-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathR2WB_runfile_pred.txt
30 lines (30 loc) · 1.63 KB
/
R2WB_runfile_pred.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## setwd for files ####
library(R2WinBUGS)
ab<-list(a=0.1,b=0.1,theta=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1),
ypred=c(0,7,1,5,1,1,5,16,0,15,4,0,0,1,1,7,1,3,0,0,8,2,13,7,0,8,0,3,2,4,1,11,0,1,2,3,3,8,6,14,3,11,6,0,1,5))
ac<-list(a=0.12,b=0.12,theta=c(1.2,1,1,1,1,1,1,1,1,1.2,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1.2,1,1,1,1,1,1,1,1,1,1,1.5,1,1,1.6,1,1,1,1),
ypred=c(0,7,1,5,1,1,5,16,0,15,4,0,0,0,0,6,1,2,0,0,8,2,13,7,0,8,0,3,2,4,1,11,0,1,2,3,3,8,6,14,3,11,6,0,1,5))
ad<-list(a=0.15,b=0.17,theta=c(1.4,1,1,1,1,1,1,1,1.8,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1.2,1,1,1,1,1,2.1,1,1,1,1,1,1,1,1,1,1.1,1,1),
ypred=c(0,7,1,5,0,0,0,0,0,0,4,0,0,1,1,7,1,3,0,0,8,2,13,7,0,8,0,3,2,4,1,11,0,1,2,3,3,8,6,14,3,11,6,0,1,5))
ainits<-list(ab,ac,ad)
adat<-list(
m=46,
y=c(0,7,1,5,1,1,5,16,0,17,4,0,0,1,1,7,1,3,0,0,8,2,13,7,0,8,0,3,2,4,1,
11,0,1,2,3,3,8,6,14,3,11,6,0,1,5),
e=c(1.129778827,6.667008775,0.650279674,6.988864371,0.95571406,1.123210345,5.908349156,8.539026017,0.601016062,18.92051111,
2.272694617,1.73736337,2.019808077,1.688099759,1.747216093,
3.221840201,1.835890594,5.221942834,0.978703751,1.254579976,
6.407553754,2.676656232,16.57884744,3.077333607,1.087083697,
7.606301637,1.018114641,2.15774619,2.844152512,2.955816698,
0.985272233,9.22871658,0.38097193,1.855596038,1.579719813,
1.579719813,2.647098065,4.791707292,4.144711859,15.70852363,
0.765228101,11.32077795,6.256478678,1.500898035,2.085492893,
7.297583004)
)
parameters<-c("mu","r","rpred")
map.sim<-bugs(adat,inits = ainits,
parameters,n.iter=10000,
model.file ="map_modelWB_pred.txt",bugs.directory="c:/WINBUGS/WinBUGS14/")