This is an implementation of the algorithm described in Section 3 of Hosszejni and Fruehwirth-Schnatter (2022). The algorithm is used to verify that the counting rule CR(r,1) holds for the sparsity pattern of the transpose of a factor loading matrix. As detailed in Section 2 of the same paper, if CR(r,1) holds, then the idiosyncratic variances are generically identified. If CR(r,1) does not hold, then we do not know whether the idiosyncratic variances are identified or not.
counting_rule_holds(delta)
an m
x r
matrix of 0
s and 1
s, where delta(i,j) == 1
if and only if
the i-th observation loads on the j-th factor
TRUE
if CR(r
,1
) holds, FALSE
otherwise
Hosszejni and Fruehwirth-Schnatter (2022). "Cover It Up! Bipartite Graphs Uncover Identifiability in Sparse Factor Analysis". arXiv:2211.00671. doi:10.48550/arXiv.2211.00671
# Two example matrices
cr_holds <-
matrix(c(1, 0, 0,
1, 0, 1,
0, 1, 0,
0, 1, 1,
0, 1, 1,
1, 1, 1,
1, 1, 1),
7, 3, byrow = TRUE)
cr_does_not_hold <-
matrix(c(1, 0, 0,
0, 0, 1,
0, 1, 0,
0, 1, 0,
0, 1, 0,
1, 1, 1,
1, 1, 1),
7, 3, byrow = TRUE)
# Check if the counting rule holds
counting_rule_holds(cr_holds)
#> [1] TRUE
#> [1] TRUE
counting_rule_holds(cr_does_not_hold)
#> [1] FALSE
#> [1] FALSE