Skip to contents

Maximum-likelihood Sigma and Theta = Sigma^-1 with zeros for the missing edges by the modified regression algorithm (ESL Alg. 17.1, eqs 17.11-17.19): each node is regressed on its neighbours using the current W.

Usage

morie_esl_ggm_fit(S, adjacency, max_iter = 1000, tol = 1e-12)

Arguments

S

Empirical covariance matrix.

adjacency

Logical or 0/1 adjacency matrix (diagonal ignored).

max_iter, tol

Convergence controls.

Value

Named list: Sigma, Theta, iterations, converged.

References

Hastie, Tibshirani & Friedman (2009), sec. 17.3.1.

Examples

S <- matrix(c(10, 1, 5, 4, 1, 10, 2, 6, 5, 2, 10, 3, 4, 6, 3, 10), 4)
A <- matrix(c(0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0), 4)
round(morie_esl_ggm_fit(S, A)$Sigma, 2)
#>       [,1]  [,2]  [,3]  [,4]
#> [1,] 10.00  1.00  1.31  4.00
#> [2,]  1.00 10.00  2.00  0.87
#> [3,]  1.31  2.00 10.00  3.00
#> [4,]  4.00  0.87  3.00 10.00