p(x) = exp(sum theta_j0 x_j + sum over edges theta_jk x_j x_k - Phi) fitted by Newton with exact moments over the 2^p states (ESL eqs 17.28-17.35); the same fit as the Poisson log-linear model of the 2^p table (eq 17.45).
Examples
t <- 1:200
Xb <- cbind(as.integer(sin(t) > 0), as.integer(sin(t) + cos(3 * t) > 0.2),
as.integer(cos(2 * t) > 0))
morie_esl_ising_fit(Xb, rbind(c(1, 2), c(2, 3)))$edges
#> theta
#> [1,] 1 2 3.0218200
#> [2,] 2 3 0.2022103
