Contents
Overview
The Ising model is a network model specifically designed for binary or dichotomous data. While the varcov and lvm families assume multivariate normal (Gaussian) distributions, the Ising model provides a principled probabilistic framework for modeling binary variables.
Originating from statistical physics, where it was developed to model ferromagnetic materials, the Ising model has found widespread application in psychology and social sciences for analyzing binary questionnaire data, such as yes/no responses, present/absent symptoms, or agree/disagree items.
The Ising model represents the joint probability distribution of binary variables through pairwise interactions, making it a natural choice for network analysis of binary data. Each edge in the network represents the association between two binary variables after controlling for all other variables in the system.
Mathematical Model
The Ising model defines the probability of observing a particular configuration of binary variables $\boldsymbol{y} = (y_1, y_2, \ldots, y_m)$ through an energy-based formulation:
$$P(\boldsymbol{Y} = \boldsymbol{y}) = \frac{1}{Z} \exp\left(-\beta\, H(\boldsymbol{y})\right)$$
Where $H(\boldsymbol{y})$ is the Hamiltonian or energy function:
$$H(\boldsymbol{y}) = -\sum_{i=1}^{m} \tau_i y_i - \sum_{i < j} \omega_{ij} y_i y_j$$
The components of this model are:
- $Z$: The partition function, a normalizing constant that ensures probabilities sum to 1. It is computed by summing over all $2^m$ possible binary configurations.
- $\beta$: The inverse temperature parameter, which controls the overall strength of network connections.
- $\tau_i$: Threshold or intercept parameters for each node, representing the baseline tendency for variable $i$ to be active (value 1) or inactive (value 0).
- $\omega_{ij}$: Pairwise interaction parameters representing the network edges between variables $i$ and $j$.
The exponential form ensures that configurations with lower energy (more negative $H$) have higher probability. Positive interactions ($\omega_{ij} > 0$) decrease energy when both variables are in the same state, making co-activation more likely.
Model Matrices
The Ising model in psychonetrics uses three main parameter matrices:
| Matrix | Description | Default |
|---|---|---|
| omega | Network interaction matrix (pairwise parameters) | "full" |
| tau | Threshold/intercept parameters (node activation) | free |
| beta | Inverse temperature (scalar, overall strength) | 1 or free |
Interpretation of Parameters
- Omega ($\omega_{ij}$):
- Positive values: Variables $i$ and $j$ tend to co-activate (both 1 or both 0)
- Negative values: Variables $i$ and $j$ tend to inhibit each other (one active, the other inactive)
- Zero: Variables are conditionally independent given all other variables
- Tau ($\tau_i$):
- Positive values: Variable $i$ has a baseline tendency to be active (state 1)
- Negative values: Variable $i$ has a baseline tendency to be inactive (state 0)
- Larger magnitude: Stronger baseline tendency
- Beta ($\beta$):
- Scales the overall strength of network connections
- Higher values: Stronger network effects, more predictable system
- Lower values: Weaker network effects, more random behavior
- Often fixed to 1 for identification
Important Notes
Input Encoding Matters
The Ising model results depend critically on whether your binary data is coded as {0, 1} or {-1, 1}. The Ising() function accepts both encodings, but they lead to different model interpretations:
- {0, 1} coding: Standard for questionnaire data (no/yes, absent/present)
- {-1, 1} coding: Common in physics and attitude modeling
You can specify the response coding explicitly via the responses argument to ensure correct interpretation.
Computational Limits
The partition function $Z$ requires summing over all $2^m$ possible states. This becomes computationally prohibitive for large networks:
- Default maximum:
maxNodes = 20 - 20 variables: $2^{20} \approx 1$ million states
- 30 variables: $2^{30} \approx 1$ billion states
For networks larger than 20 nodes, computation time increases exponentially. Consider using approximation methods or sampling-based approaches for very large networks.
Estimator Support
Only Maximum Likelihood (ML) and Penalized Maximum Likelihood (PML) estimators are supported for Ising models. Other estimators available in psychonetrics (FIML, WLS, DWLS, ULS) are not applicable to binary data models.
Example: Single-Group Ising Model
This example demonstrates fitting an Ising model to the Jonas dataset, which contains 10 binary attitude items about a researcher named Jonas.
Step 1: Load and Inspect Data
library("psychonetrics")
library("dplyr")
# Load the Jonas dataset (built into psychonetrics)
data(Jonas)
# The dataset contains 10 binary attitude items and a grouping variable
vars <- names(Jonas)[1:10]
head(Jonas)
# Check data structure
str(Jonas)
# 215 participants rated 10 yes/no attitude items
Step 2: Fit a Saturated Ising Model
Start with a fully saturated model where all pairwise interactions are estimated:
# Fit saturated Ising model (all edges free)
mod <- Ising(Jonas, vars = vars, omega = "full")
mod <- mod %>% runmodel
# Inspect model
mod
# View all parameters
mod %>% parameters
# Check fit (saturated model should fit perfectly)
mod %>% fit
Step 3: Prune Non-Significant Edges
Remove edges that are not statistically significant to obtain a sparse network:
# Prune edges with p > 0.05
mod_pruned <- mod %>% prune(alpha = 0.05)
# Check how many edges remain
mod_pruned %>% parameters %>%
filter(matrix == "omega", !fixed) %>%
nrow()
Step 4: Stepup Search
Add back edges that significantly improve model fit using modification indices:
# Stepup search: add edges that improve fit
mod_final <- mod_pruned %>% stepup(alpha = 0.05)
# Compare models
compare(
saturated = mod,
pruned = mod_pruned,
final = mod_final
)
Step 5: Extract and Visualize Network
# Extract the omega (interaction) matrix
omega <- getmatrix(mod_final, "omega")
# Visualize with qgraph
library("qgraph")
qgraph(omega,
labels = vars,
theme = "colorblind",
cut = 0,
layout = "spring",
title = "Jonas Attitude Network")
# Positive edges (green): items tend to co-occur
# Negative edges (red): items tend to be mutually exclusive
Example: Multi-Group Ising Analysis
Multi-group Ising models allow us to test whether network structures differ between populations. This example compares attitude networks between people who know Jonas personally versus those who do not.
Step 1: Prepare Data
# Order data so "Doesn't know" group comes first
# (group 1 = doesn't know, group 2 = knows Jonas)
Jonas <- Jonas[order(Jonas$group), ]
# Check group sizes
table(Jonas$group)
Step 2: Test Progressive Constraints
We fit a series of increasingly constrained models to test different levels of invariance:
Model 1: All Parameters Free
# Configural model: all parameters free across groups
mod1 <- Ising(Jonas, vars = vars, groups = "group") %>%
runmodel
# Sparse version: prune and stepup
mod1b <- mod1 %>%
prune(alpha = 0.05) %>%
stepup(alpha = 0.05)
Model 2: Equal Networks
# Constrain omega (network) to be equal across groups
mod2 <- mod1 %>%
groupequal("omega") %>%
runmodel
# Sparse version with equality constraints
mod2b <- mod2 %>%
prune(alpha = 0.05) %>%
stepup(mi = "mi_equal", alpha = 0.05)
Model 3: Equal Networks + Equal Thresholds
# Constrain both omega and tau to be equal
mod3 <- mod2 %>%
groupequal("tau") %>%
runmodel
mod3b <- mod3 %>%
prune(alpha = 0.05) %>%
stepup(mi = "mi_equal", alpha = 0.05)
Model 4: Fully Equal (Including Beta)
# All parameters equal across groups
mod4 <- mod3 %>%
groupequal("beta") %>%
runmodel
mod4b <- mod4 %>%
prune(alpha = 0.05) %>%
stepup(mi = "mi_equal", alpha = 0.05)
Step 3: Compare All Models
# Compare all models by information criteria
compare(
"free (dense)" = mod1,
"free (sparse)" = mod1b,
"equal omega (dense)" = mod2,
"equal omega (sparse)" = mod2b,
"equal omega+tau (dense)" = mod3,
"equal omega+tau (sparse)"= mod3b,
"fully equal (dense)" = mod4,
"fully equal (sparse)" = mod4b
) %>% arrange(BIC)
# Model with lowest BIC is preferred
Step 4: Interpret Results
# If equal network model fits well:
# → Network structure is the same across groups
# If only free model fits:
# → Network structure differs between groups
# Extract group-specific networks if they differ
omega_group1 <- getmatrix(mod1b, "omega", group = 1)
omega_group2 <- getmatrix(mod1b, "omega", group = 2)
# Visualize both networks
par(mfrow = c(1, 2))
qgraph(omega_group1, layout = "spring", cut = 0, title = "Doesn't Know Jonas")
qgraph(omega_group2, layout = "spring", cut = 0, title = "Knows Jonas")
mi = "mi_equal" to ensure modification indices respect the constraints.
Interpretation Guide
Understanding Ising model parameters requires careful attention to their probabilistic interpretation:
Network Edges (Omega)
- Positive $\omega_{ij}$: Variables $i$ and $j$ tend to co-activate. When one is present (1), the other is more likely to be present as well.
- Negative $\omega_{ij}$: Variables $i$ and $j$ tend to inhibit each other. When one is present, the other is less likely to be present.
- Zero $\omega_{ij}$: No direct association. The variables are conditionally independent given all other variables in the network.
- Magnitude: Larger absolute values indicate stronger associations. The effect is multiplicative in the probability scale.
Thresholds (Tau)
The interpretation of thresholds depends on the data coding. For {−1, 1} coded data, thresholds represent the baseline tendency of a node toward one state over the other when all other variables are neutral. For {0, 1} coded data, the interpretation is more complex. See Epskamp, Haslbeck, Isvoranu & Van Borkulo (2022) for a detailed discussion.
Temperature (Beta)
- Higher $\beta$: Stronger overall network connectivity. The system behaves more deterministically based on network structure.
- Lower $\beta$: Weaker network influence. Variables behave more independently, with more random variation.
- Typical use: Often fixed to 1 for model identification, but can be freely estimated or constrained across groups.
Conditional Independence
A key feature of the Ising model is that it represents the conditional dependence structure of binary variables:
- An edge between variables A and B means they are associated even after accounting for all other variables
- Absence of an edge means conditional independence: A and B are unrelated when controlling for all other variables
- This parallels the interpretation of partial correlations in Gaussian graphical models
Summary
The Ising model extends network analysis to binary and dichotomous data. Key takeaways:
- The Ising model provides a principled probabilistic framework for binary networks
- It models the joint distribution of binary variables through pairwise interactions and thresholds
- Network edges (omega) represent conditional associations between binary variables
- Thresholds (tau) represent baseline activation tendencies for each node
- The inverse temperature (beta) scales the overall strength of network connections
- Multi-group analysis allows testing whether network structures differ across populations
- Computational complexity limits practical applications to approximately 20 nodes
- Only ML and PML estimators are supported for Ising models
Limitations
- Sample size: Binary data provides less information than continuous data, requiring larger samples for stable estimation
- Model complexity: The partition function grows exponentially with the number of variables
- Identification: Care must be taken with parameter constraints to ensure model identification
- Sparsity: Dense networks with many variables can be difficult to estimate accurately
When to Use the Ising Model
The Ising model is appropriate when:
- Your data consists of binary or dichotomous variables
- You have a moderate number of variables (typically ≤ 20)
- You want to model the conditional dependence structure of binary items
- You're interested in how binary symptoms, attitudes, or behaviors interact
Next Steps
Now that you understand the Ising model, explore:
- General Tutorial for the full psychonetrics workflow
- Varcov Family for continuous data network models
- LVM Family for latent variable models
- Examples for more advanced applications
Further Reading
For theoretical background on the Ising model in psychology:
- van Borkulo, C. D., et al. (2014). A new method for constructing networks from binary data. Scientific Reports, 4, 5918.
- Marsman, M., et al. (2018). An introduction to network psychometrics: Relating Ising network models to item response theory models. Multivariate Behavioral Research, 53(1), 15-35.
- Epskamp, S., Maris, G., Waldorp, L. J., & Borsboom, D. (2018). Network psychometrics. In P. Irwing, T. Booth, & D. J. Hughes (Eds.), The Wiley handbook of psychometric testing (pp. 953-986). Wiley.