This website provides data and code for the new housing, yield, and credit spread factors developed in Sparse Macro-Finance Factors, co-authored by Dave Rapach and Guofu Zhou. The figure depicts log cumulative returns for mimicking portfolios for the housing, yield, and credit spread factors, which are the three sparse macro-finance factors that earn significant risk premia.
Disclaimer: Dave Rapach solely maintains this website; the views expressed here are his own and are not necessarily those of the Federal Reserve Bank of Atlanta or the Federal Reserve System.
July 2025 data vintage: mimicking-portfolio return data for the housing, yield, and credit spread factors, 1963:07–2023:12 [CSV]
Data and code to generate mimicking-portfolio returns for the sparse macro-finance factors are available in SparseMacroFinanceFactors.zip, which contains three files:
dataMacro.csv: transformed data for 118 macro-finance variables
dataTest.csv: excess return data for 633 test assets
programScaSpca.R: R program file to generate mimicking-portfolio returns for the sparse macro-finance factors
Acknowledgments:
Sparse principal components are computed via sparse component analysis (SCA) using the R package epca by Fan Chen; SCA is developed in Fan Chen and Karl Rohe, A New Basis for Sparse Principal Component Analysis, Journal of Computational and Graphical Statistics, 2023, 33(2), 421–434
Mimicking portfolios for the sparse macro-finance factors are computed using supervised principal component analysis (SPCA) and R code adapted from the MATLAB code available on Dacheng Xiu’s webpage; SPCA is developed in Stefano Giglio, Dacheng Xiu, and Dake Zhang, Test Assets and Weak Factors, Journal of Finance, 2025, 80(1), 259–319
The Bayesian risk factor selection methodology in Section 4.3 in the paper used the R package czfactor by Sid Chib; the methodology is developed in Siddhartha Chib and Xiaming Zeng, Which Factors are Risk Factors in Asset Pricing: A Model Scan Framework, Journal of Business and Economic Statistics, 2020, 38(4), 771–783