This is a short introduction to the sparvaride package. The package implements the variance identification algorithm for sparse factor analysis described in the paper “Cover It Up! Bipartite Graphs Uncover Identifiability in Sparse Factor Analysis” by Darjus Hosszejni and Sylvia Frühwirth-Schnatter. The paper is published in the Journal of Multivariate Analysis.

The package is still under development and the API is subject to change.

Problem Statement

At the moment, the package has a single exported function called counting_rule_holds with one input variable: a binary matrix δ{0,1}m×r\delta\in\{0,1\}^{m\times r}. This binary matrix δ\delta should be the sparsity pattern of the factor loading matrix βm×r\beta\in\mathbb{R}^{m\times r} in sparse factor analysis: yi=βfi+ϵi,y_i = \beta f_i + \epsilon_i, where yimy_i\in\mathbb{R}^m is the iith vector of observations, firf_i\in\mathbb{R}^r is the iith vector of latent factors, ϵim\epsilon_i\in\mathbb{R}^m is the iith vector of idiosyncratic errors, and i=1,...,ni=1,...,n. In sparse factor analysis, the factor loading matrix β\beta may be sparse, i.e., β\beta may only have a small number of non-zero entries. Importantly, β\beta may have (estimated) structural zeros, and the sparsity pattern is δ=I(β0)\delta=I(\beta \neq 0), where I()I() is the indicator function. For mathematical tractability, we assume orthogonal factors, i.e., cov(fi)=Ir\text{cov}(f_i)=I_r identity, and homoskedasticity for the observation series, i.e., cov(ϵi)\text{cov}(\epsilon_i) is diagonal.

In this setup, the covariance matrix cov(ϵi)\text{cov}(\epsilon_i) of the idiosyncratic errors may not be uniquely identified if there are too many zeros in β\beta (and thus in δ\delta). The 3579 counting rule is a sufficient condition for the uniqueness of the covariance matrix cov(ϵi)\text{cov}(\epsilon_i). More information on the 3579 counting rule can be found in the paper “Cover It Up! Bipartite Graphs Uncover Identifiability in Sparse Factor Analysis” by Darjus Hosszejni and Sylvia Frühwirth-Schnatter at https://doi.org/10.1016/j.jmva.2025.105536.

The 3579 Counting Rule

Def. Let δ{0,1}m×r\delta\in\{0,1\}^{m\times r} be a binary matrix. Then, the 3579 counting rule is the following condition: for all q=1,...,rq=1,...,r, all submatrices of δ\delta consisting of qq columns of δ\delta have at least 2q+12q+1 non-zero entries.

For example, for δ1\delta_1 below the counting rule does not hold because there is a qq (namely, q=1q=1), such that there is a submatrix of δ1\delta_1 consisting of 11 column of δ1\delta_1 that has only 2q=22q=2 non-zero entries: the middle column. For δ2\delta_2, however, the counting rule holds because there is no qq such that there is a submatrix of δ2\delta_2 consisting of qq columns of δ2\delta_2 that has only 2q2q non-zero entries.

δ1=(100010001111101101101),δ2=(100010001111101111101)\delta_1=\begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 1 & 1 \\ 1 & 0 & 1 \\ 1 & 0 & 1 \\ 1 & 0 & 1 \end{pmatrix}, \quad\quad\quad \delta_2=\begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 1 & 1 \\ 1 & 0 & 1 \\ 1 & 1 & 1 \\ 1 & 0 & 1 \end{pmatrix}

The counting_rule_holds Function

We can check whether the 3579 counting rule holds for a given binary matrix delta using the counting_rule_holds function in the sparvaride package.

We define two matrices as above in R:

delta1 <-
  matrix(c(1, 0, 0,
           0, 1, 0,
           0, 0, 1,
           1, 1, 1,
           1, 0, 1,
           1, 0, 1,
           1, 0, 1),
         nrow = 7, ncol = 3,
         byrow = TRUE)
delta2 <-
  matrix(c(1, 0, 0,
           0, 1, 0,
           0, 0, 1,
           1, 1, 1,
           1, 0, 1,
           1, 1, 1,
           1, 0, 1),
         nrow = 7, ncol = 3,
         byrow = TRUE)

Then, we call the counting_rule_holds function on these matrices:

counting_rule_holds(delta1)
#> [1] FALSE
counting_rule_holds(delta2)
#> [1] TRUE

Citation

For citing our work, please check the citation function in R:

citation("sparvaride")
#> To cite sparvaride in publications use:
#> 
#>   Hosszejni D, Frühwirth-Schnatter S (2026). "Cover It Up! Bipartite
#>   Graphs Uncover Identifiability in Sparse Factor Analysis." _Journal
#>   of Multivariate Analysis_, *211*, 105536. ISSN 0047-259X,
#>   doi:10.1016/j.jmva.2025.105536
#>   <https://doi.org/10.1016/j.jmva.2025.105536>.
#> 
#> A BibTeX entry for LaTeX users is
#> 
#>   @Article{,
#>     title = {Cover It Up! Bipartite Graphs Uncover Identifiability in Sparse Factor Analysis},
#>     author = {Darjus Hosszejni and Sylvia Frühwirth-Schnatter},
#>     journal = {Journal of Multivariate Analysis},
#>     year = {2026},
#>     volume = {211},
#>     pages = {105536},
#>     issn = {0047-259X},
#>     doi = {10.1016/j.jmva.2025.105536},
#>   }