Skip to main content
QUICK REVIEW

[Paper Review] sparseDFM: An R Package to Estimate Dynamic Factor Models with Sparse Loadings

Luke M. Mosley, Tak-Shing Chan|arXiv (Cornell University)|Mar 23, 2023
Monetary Policy and Economic ImpactEconomics, Econometrics and Finance4 citations
TL;DR

This paper introduces the sparseDFM R package for estimating dynamic factor models with sparse loadings using a novel expectation-maximization algorithm with l1 regularization, improving interpretability by identifying key variables driving latent factors. The method outperforms traditional DFMs in nowcasting accuracy, reducing mean absolute error by up to 20% in real-world applications on UK trade and inflation data.

ABSTRACT

sparseDFM is an R package for the implementation of popular estimation methods for dynamic factor models (DFMs) including the novel Sparse DFM approach of Mosley et al. (2023). The Sparse DFM ameliorates interpretability issues of factor structure in classic DFMs by constraining the loading matrices to have few non-zero entries (i.e. are sparse). Mosley et al. (2023) construct an efficient expectation maximisation (EM) algorithm to enable estimation of model parameters using a regularised quasi-maximum likelihood. We provide detail on the estimation strategy in this paper and show how we implement this in a computationally efficient way. We then provide two real-data case studies to act as tutorials on how one may use the sparseDFM package. The first case study focuses on summarising the structure of a small subset of quarterly CPI (consumer price inflation) index data for the UK, while the second applies the package onto a large-scale set of monthly time series for the purpose of nowcasting nine of the main trade commodities the UK exports worldwide.

Motivation & Objective

  • To address the interpretability problem in classic dynamic factor models (DFMs), where dense loadings obscure the relationship between observed variables and latent factors.
  • To develop a computationally efficient R package for estimating sparse DFMs using regularized quasi-maximum likelihood via an EM algorithm.
  • To demonstrate the practical benefits of sparse loadings in real-world applications, including economic nowcasting and inflation data summarization.
  • To provide a scalable, maintainable tool for researchers and practitioners to apply sparse DFMs to high-dimensional time series with mixed frequencies and missing data.

Proposed method

  • The method employs an expectation-maximization (EM) algorithm with l1-norm regularization to estimate sparse loading matrices, promoting zero entries and enhancing interpretability.
  • The algorithm uses a regularized quasi-maximum likelihood framework to jointly estimate factor loadings, factors, and error variances under sparsity constraints.
  • Kalman filtering and smoothing are implemented in C++ via the Armadillo library for computational efficiency, supporting both multivariate and univariate Kalman filters.
  • ADMM (Alternating Direction Method of Multipliers) updates are used within the EM framework to accelerate convergence of the sparse estimation process.
  • The package supports two error assumptions: i.i.d. white noise and AR(1) serial correlation for idiosyncratic errors.
  • Model tuning is performed via cross-validation or expanding window procedures to select optimal l1 penalty parameters.
Figure 1 : Output of missing_data_plot(data) showing the amount of missing data in the inflation example.
Figure 1 : Output of missing_data_plot(data) showing the amount of missing data in the inflation example.

Experimental results

Research questions

  • RQ1Can sparse loadings in dynamic factor models improve the interpretability of factor structures by identifying key contributing variables?
  • RQ2Does the proposed sparse DFM estimation method outperform traditional DFMs in forecasting accuracy, particularly in real-time nowcasting?
  • RQ3How does the computational efficiency of the EM-sparse algorithm compare to standard DFM estimation in high-dimensional settings?
  • RQ4To what extent can sparse loadings help identify meaningful economic groupings in macroeconomic and trade data?

Key findings

  • The sparse DFM approach significantly improves interpretability by producing sparse loading matrices, allowing users to associate specific factors with distinct groups of variables.
  • In the UK trade nowcasting case study, the sparse DFM reduced the average mean absolute error by 20.5% for horizon 1 and 18.2% for horizon 2 compared to the classic DFM.
  • The pseudo real-time nowcasting exercise over 48 months showed tighter error distributions for the sparse DFM, with median errors 10-15% lower than the classic DFM.
  • The EM-sparse algorithm achieved stable convergence and computational efficiency, enabling scalable estimation on large datasets with mixed-frequency and missing data.
  • The case study on UK CPI data revealed that the sparse DFM successfully isolated factors linked to specific inflation categories, enhancing structural interpretation.
  • The sparseDFM R package is available on CRAN and includes features for model fitting, forecasting, and diagnostics, with future extensions planned for enhanced visualization and modeling flexibility.
Figure 2 : Output of plot() with type = “loading.heatmap” showing a heatmap of the estimated loadings from Sparse DFM fit on the inflation data.
Figure 2 : Output of plot() with type = “loading.heatmap” showing a heatmap of the estimated loadings from Sparse DFM fit on the inflation data.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.