-
Notifications
You must be signed in to change notification settings - Fork 1
/
NimbleCB.R
29 lines (25 loc) · 836 Bytes
/
NimbleCB.R
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
require(nimble)
source("simulateCB.R")
options(mc.cores = parallel::detectCores())
source('nimCB.R')
nimCBdata <- list(obs=sim$Iobs)
nimCBcon <- list(numobs=numobs,N=N,i0=i0)
nimCBinits <- list(I=sim$I,
effprop=effprop,
beta=beta,
reporting=reporting,
N0=N0
)
NimbleCB <- MCMCsuite(code=nimcode,
data=nimCBdata,
inits=nimCBinits,
constants=nimCBcon,
MCMCs=c("jags","nimble","nimble_slice"),
monitors=c("beta","reporting","effprop"),
calculateEfficiency=TRUE,
niter=10000,
makePlot=FALSE,
savePlot=FALSE)
print(NimbleCB$timing)
print(NimbleCB$summary)
saveRDS(NimbleCB,file="NimbleCB")