TwoStepSDFM

A C++-based R implementation of the two-step estimation procedure for a (linear Gaussian) Sparse Dynamic Factor Model (SDFM) as outlined in Franjic and Schweikert (2024).

Introduction

The TwoStepSDFM package provides a fast implementation of the Kalman Filter and Smoother (hereinafter KFS, see Koopman and Durbin, 2000) to estimate factors in a mixed-frequency SDFM framework, explicitly accounting for cross-sectional correlation in the measurement error. The KFS is initialized using results from Sparse Principal Components Analysis (SPCA) by Zou and Hastie (2006) in a preliminary step. This approach generalizes the two-step estimator for approximate dynamic factor models by Giannone, Reichlin, and Small (2008) and Doz, Giannone, and Reichlin (2011). For more details see Franjic and Schweikert (2024).

Main Features

Side Features

Prerequisites

Installation

Compile from scratch

Rcpp and RcppEigen can be downloaded from CRAN or directly installed from within R by calling install.packages("...").

To install the package itself, a short R script is provided (see PackageBuilder.R). The package currently only compiles with the g++/gcc compiler.

Usage

For a quick step-by-step user guide of the main features, see the package vignette.

License

License: GPL v3

  1. 2024-2026 Domenic Franjic

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

To Contribute:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Commit your changes with descriptive messages.
  4. Push to your fork and submit a pull request.

Support

If you have any questions or need assistance, please open an issue on the GitHub repository or contact us via email.

Contact

References

Papers

Books

Software / Packages