Isinglandr
:
Landscape Construction and Simulation for Ising Networks
A toolbox for constructing potential landscapes for Ising networks.
The parameters of the networks can be directly supplied by users or
estimated by the IsingFit
package by van Borkulo and
Epskamp (2016) https://CRAN.R-project.org/package=IsingFit from
empirical data. The Ising model’s Boltzmann distribution is preserved
for the potential landscape function. The landscape functions can be
used for quantifying and visualizing the stability of network states, as
well as visualizing the simulation process.
You can install the development version of Isinglandr from GitHub with:
# install.packages("devtools")
::install_github("Sciurus365/Isinglandr") devtools
library(Isinglandr)
#> Registered S3 method overwritten by 'Isinglandr':
#> method from
#> print.landscape simlandr
# A toy network and its landscape
<- 10
Nvar <- rep(0, Nvar)
m <- matrix(0.1, Nvar, Nvar)
w diag(w) <- 0
<- make_2d_Isingland(m, w)
result1 plot(result1)
## What if the network becomes denser?
<- make_2d_Isingland(m, 1.5 * w)
result2 plot(result2)
## What if the thresholds become lower?
<- make_2d_Isingland(m - 0.5, w)
result3 plot(result3)
## Multiple networks together
<- make_Ising_grid(
result4 all_thresholds(seq(-0.1, 0.1, 0.1), .f = `+`),
whole_weiadj(seq(0.5, 1.5, 0.5)),
m, w%>% make_2d_Isingland_matrix()
) plot(result4)
#> Scale for x is already present.
#> Adding another scale for x, which will replace the existing scale.
set.seed(1614)
<- simulate_Isingland(result1, initial = 5)
sim1 plot(sim1)
set.seed(1614)
<- simulate_Isingland(result4, initial = 5)
sim4 plot(sim4)
A shiny app is included in this package to show the landscape for the
Ising network of major depressive disorder. The network parameters can
be manipulated to see how they influence the landscape and the
simulation. Run shiny_Isingland_MDD()
to start it.