## Not run:
# # simulate a dataset using IsingSampler
# library(IsingSampler)
# n = 1e3
# p = 10
# Theta <- matrix(sample(c(-0.5,0,0.5), replace = TRUE, size = p*p), nrow = p, ncol = p)
# Theta <- Theta + t(Theta) # adjacency matrix must be symmetric
# diag(Theta) <- 0
# X <- unname(as.matrix(IsingSampler(n, graph = Theta, thresholds = 0, method = "direct") ))
# m1 <- ising(X, symmetrize = "mean", gamma = 0.5, nlambda = 50)
#
# # Visualize output using igraph
# library(igraph)
# ig <- graph_from_adjacency_matrix(m1$Theta, "undirected", weighted = TRUE, diag = FALSE)
# plot.igraph(ig, vertex.color = "skyblue")
# ## End(Not run)
Run the code above in your browser using DataLab