The Ising model is the binary analogue of the
Gaussian graphical model: a network for 0/1 data, where
each edge is a conditional association between two binary variables.
psychnets fits it by nodewise L1-penalised logistic
regression with EBIC selection (method = "ising",
equivalent to IsingFit::IsingFit()), or unregularised with
Wald-based pruning (method = "ising_sampler"). Both
self-certify via the nodewise GLM stationarity residual.
The construct scores are continuous, so we first binarise them with
dichotomize() – here into “high” vs “low” on each
construct. A median split on coarse data is often badly unbalanced;
method = "rank" gives a balanced ~50/50 split robust to
ties.
fit <- psychnet(bin, method = "ising", rule = "AND")
fit
#> <psychnet> ising network
#> nodes: 5 edges: 7 (undirected)
#> optimality (KKT residual): 3.74e-10
certificate(fit)
#> method certificate kind certified
#> 1 ising 3.74261e-10 kkt TRUEThe edges are the symmetrised conditional associations between constructs:
as.data.frame(fit)
#> from to weight
#> 1 CSU IV 1.8544649
#> 2 CSU SE 2.1878175
#> 3 IV SE 1.2096869
#> 4 CSU SR 0.9036773
#> 5 IV SR 2.2416461
#> 6 SE SR 1.3762314
#> 7 SR TA -0.3468242Predictability for binary nodes is classification accuracy above the
marginal baseline (nCC); it needs the data the model was
fit on:
method = "ising_sampler" is the unregularised
counterpart; with alpha it prunes edges by a Wald p-value
instead of shrinking them.