{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/fitting-multilevel-factor-models","title":"Fitting Multilevel Factor Models","arxiv_id":"2409.12067","date":"2024-09-18","proceeding":null,"authors":["Tetiana Parshakova","Trevor Hastie","Stephen Boyd"],"abstract":"We examine a special case of the multilevel factor model, with covariance given by multilevel low rank (MLR) matrix~\\cite{parshakova2023factor}. We develop a novel, fast implementation of the expectation-maximization algorithm, tailored for multilevel factor models, to maximize the likelihood of the observed data. This method accommodates any hierarchical structure and maintains linear time and storage complexities per iteration. This is achieved through a new efficient technique for computing the inverse of the positive definite MLR matrix. We show that the inverse of positive definite MLR matrix is also an MLR matrix with the same sparsity in factors, and we use the recursive Sherman-Morrison-Woodbury matrix identity to obtain the factors of the inverse. Additionally, we present an algorithm that computes the Cholesky factorization of an expanded matrix with linear time and space complexities, yielding the covariance matrix as its Schur complement. This paper is accompanied by an open-source package that implements the proposed methods.","url_abs":"https://arxiv.org/abs/2409.12067v3","url_pdf":"https://arxiv.org/pdf/2409.12067v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"fitting-multilevel-factor-models","repo_url":"https://github.com/cvxgrp/multilevel_factor_model","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2409.12067","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2409.12067"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/cvxgrp/multilevel_factor_model","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":6,"unverified":4},"by_repo_kind":{"official":{"samples":10,"ran":6,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"ed6ba062dc566cc8","entry":"low_rank_approx","repo":"cvxgrp/multilevel_factor_model","repo_kind":"official","path":"mfmodel/utils.py","file_url":"https://github.com/cvxgrp/multilevel_factor_model/blob/HEAD/mfmodel/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ed6ba062dc566cc8"}},{"code_sha256_prefix":"1a5c621581bac650","entry":"mlr_matvec","repo":"cvxgrp/multilevel_factor_model","repo_kind":"official","path":"mfmodel/mlr_matmul.py","file_url":"https://github.com/cvxgrp/multilevel_factor_model/blob/HEAD/mfmodel/mlr_matmul.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1a5c621581bac650"}},{"code_sha256_prefix":"d50500faeebdccd4","entry":"mult_blockdiag_refined_AtB","repo":"cvxgrp/multilevel_factor_model","repo_kind":"official","path":"mfmodel/inverse.py","file_url":"https://github.com/cvxgrp/multilevel_factor_model/blob/HEAD/mfmodel/inverse.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d50500faeebdccd4"}},{"code_sha256_prefix":"ef521c44c1904120","entry":"mult_blockdiag_refined_BCt","repo":"cvxgrp/multilevel_factor_model","repo_kind":"official","path":"mfmodel/mlr_matmul.py","file_url":"https://github.com/cvxgrp/multilevel_factor_model/blob/HEAD/mfmodel/mlr_matmul.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ef521c44c1904120"}},{"code_sha256_prefix":"5aad5be17baa3de7","entry":"mult_blockdiag_refined_CtB","repo":"cvxgrp/multilevel_factor_model","repo_kind":"official","path":"mfmodel/mlr_matmul.py","file_url":"https://github.com/cvxgrp/multilevel_factor_model/blob/HEAD/mfmodel/mlr_matmul.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5aad5be17baa3de7"}},{"code_sha256_prefix":"dda08af0aa8b1a20","entry":"mult_blockdiag_refined_CtB_vh","repo":"cvxgrp/multilevel_factor_model","repo_kind":"official","path":"mfmodel/inverse.py","file_url":"https://github.com/cvxgrp/multilevel_factor_model/blob/HEAD/mfmodel/inverse.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"dda08af0aa8b1a20"}},{"code_sha256_prefix":"2cfe05d7bb11a40c","entry":"fast_EM_intermediate_matrices","repo":"cvxgrp/multilevel_factor_model","repo_kind":"official","path":"mfmodel/fast_em_algorithm.py","file_url":"https://github.com/cvxgrp/multilevel_factor_model/blob/HEAD/mfmodel/fast_em_algorithm.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2cfe05d7bb11a40c"}},{"code_sha256_prefix":"c1dbdfef767b82d5","entry":"fast_EM_intermediate_matrices_base","repo":"cvxgrp/multilevel_factor_model","repo_kind":"official","path":"mfmodel/fast_em_algorithm.py","file_url":"https://github.com/cvxgrp/multilevel_factor_model/blob/HEAD/mfmodel/fast_em_algorithm.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c1dbdfef767b82d5"}},{"code_sha256_prefix":"97c969723353df2a","entry":"fit","repo":"cvxgrp/multilevel_factor_model","repo_kind":"official","path":"mfmodel/fast_em_algorithm.py","file_url":"https://github.com/cvxgrp/multilevel_factor_model/blob/HEAD/mfmodel/fast_em_algorithm.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"97c969723353df2a"}},{"code_sha256_prefix":"d9b225109527d824","entry":"mult_blockdiag_refined_AB","repo":"cvxgrp/multilevel_factor_model","repo_kind":"official","path":"mfmodel/inverse.py","file_url":"https://github.com/cvxgrp/multilevel_factor_model/blob/HEAD/mfmodel/inverse.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d9b225109527d824"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}