if (FALSE) {
library("dplyr")
# Simulate a small Blume-Capel data set (requires the development version of
# IsingSampler that supports the 'delta' argument):
library("IsingSampler")
nNode <- 5
graph <- 0.4 * (matrix(1, nNode, nNode) - diag(nNode)) *
(matrix(c(0,1,0,0,1, 1,0,1,0,0, 0,1,0,1,0, 0,0,1,0,1, 1,0,0,1,0), 5, 5))
data <- IsingSampler(1000, graph = graph, thresholds = rep(0, nNode),
beta = 1, delta = 1, responses = c(-1, 0, 1))
# Blume-Capel model with all quadratic (delta) potentials constrained equal,
# and all thresholds (tau) constrained equal, within the group:
mod <- BlumeCapel(data, responses = c(-1, 0, 1)) %>%
allequal("delta") %>%
allequal("tau") %>%
runmodel
}
Run the code above in your browser using DataLab