Identify Loading Vectors under Sparsity in Factor Models

Simplify the loading matrix in factor models using the l1 criterion as proposed in Freyaldenhoven (2025) . Given a data matrix, find the rotation of the loading matrix with the smallest l1-norm and/or test for the presence of local factors with main function local_factors().


CRANstatus CRAN RStudio mirrordownloads

Overview

The l1rotation package implements the l1-rotation criterion of Freyaldenhoven (2025) to simplify the loading matrix in factor models.

Installation

# Install from CRAN
install.packages("l1rotation")

# Install latest version from GitHub
install.packages("devtools")
devtools::install_github("SimonFreyaldenhoven/l1rotation")

Usage

Find a minimal example below. For more information see the package website, documentation and vignette.

library(l1rotation)
set.seed(916) 

# Minimal example with 2 factors, where X is a 224 by 207 matrix
lf <- local_factors(X = example_data, r = 2)

# Rerun with parallel processing
lf_lambdas <- local_factors(X = example_data, r = 2, parallel = TRUE, n_cores = 10)

# Visualize Principal Component estimate of the loadings
lf$pc_plot


# Visualize l1-rotation loadings
lf$rotated_plot

Citation

Simon Freyaldenhoven. “Identification Through Sparsity in Factor Models: the l1-rotation criterion.” Philadelphia Fed Working Paper 20-25, February 2025.

Simon Freyaldenhoven, Ryan Kobler. “l1rotation package.” Code and data repository at https://github.com/SimonFreyaldenhoven/l1rotation, March 2025.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("l1rotation")

1.0.1 by Ryan Kobler, a year ago


https://kobleary.github.io/l1rotation/, https://github.com/SimonFreyaldenhoven/l1rotation


Report a bug at https://github.com/SimonFreyaldenhoven/l1rotation/issues


Browse source code at https://github.com/cran/l1rotation


Authors: Simon Freyaldenhoven [aut, cph] , Ryan Kobler [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports cli, doParallel, dplyr, foreach, ggplot2, magrittr, matrixStats, pracma, scales, stats

Suggests knitr, quarto, rmarkdown, testthat


See at CRAN