View source: R/BreakPointLoss.R
BreakPointLoss | R Documentation |
Compute the Average Loss of Hidden State Changes from Expected Break Points
BreakPointLoss(model.list, waic = FALSE, display = TRUE)
model.list |
MCMC output objects. These have to be of class
|
waic |
If |
display |
If
|
BreakPointLoss
returns five objects. They are: ave.loss
the expected loss for each model
computed by the mean sqaured distance of hidden state changes from the expected break points.
logmarglike
the natural log of the marginal likelihood for each model; State
sampled state vectors;
Tau
expected break points for each model; and Tau.samp
sampled break points from hidden state draws.
Jong Hee Park and Yunkyun Sohn. 2020. "Detecting Structural Change in Longitudinal Network Data." Bayesian Analysis. Vol.15, No.1, pp.133-157.
## 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"]]) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.