# NOT RUN {
# }
# NOT RUN {
set.seed(1973)
## Generate an array (30 by 30 by 40) with block transitions
from 2 blocks to 3 blocks
Y <- MakeBlockNetworkChange(n=10, T=40, type ="split")
G <- 100 ## Small mcmc scans to save time
## Fit multiple models for break number detection using Bayesian model comparison
out0 <- NetworkStatic(Y, R=2, mcmc=G, burnin=G, verbose=G, Waic=TRUE)
out1 <- NetworkChange(Y, R=2, m=1, mcmc=G, burnin=G, verbose=G, Waic=TRUE)
out2 <- NetworkChange(Y, R=2, m=2, mcmc=G, burnin=G, verbose=G, Waic=TRUE)
out3 <- NetworkChange(Y, R=2, m=3, mcmc=G, burnin=G, verbose=G, Waic=TRUE)
## The most probable model given break number 0 to 3 and data is out1 according to WAIC
out <- BreakPointLoss(out0, out1, out2, out3, waic=TRUE)
print(out[["ave.loss"]])
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab