tidy-finance/factor-library-grid
Tidy Finance Factor Library: Specification Grid Lookup table that maps each specification id to its portfolio construction choices. Use it together with the Portfolio Returns dataset to select return series and to identify the choices behind each series. Dataset Details Dataset Description The grid contains 4,105,728 specifications for 179 sorting variables. Each row defines a complete set of construction choices: sample exclusions, lagging… See the full description on the dataset page: https://huggingface.co/datasets/tidy-finance/factor-library-grid.
Tidy Finance Factor Library: Specification Grid
Lookup table that maps each specification id to its portfolio construction choices. Use it together with the Portfolio Returns dataset to select return series and to identify the choices behind each series.
Dataset Details
Dataset Description
The grid contains 4,105,728 specifications for 179 sorting variables. Each row defines a complete set of construction choices: sample exclusions, lagging convention, breakpoints, sorting method, weighting scheme, and rebalancing frequency. The id column links to the corresponding return series in the Portfolio Returns dataset.
- Curated by: Christoph Frey (Lancaster University), Christoph Scheuch (Tidy Intelligence), Stefan Voigt (University of Copenhagen), Patrick Weiss (Reykjavík University)
- Funded by: Danish Finance Institute
- License: CC0 1.0
Dataset Sources
- Construction pipeline: github.com/tidy-finance/factor-library
- Portfolio returns: tidy-finance/factor-library
- R package: github.com/tidy-finance/r-tidyfinance
- Python package: github.com/tidy-finance/py-tidyfinance
- Demo: factors.tidy-finance.org
Uses
Direct Use
- Joining with the Portfolio Returns dataset to filter or group factor returns by specific methodological choices.
- Robustness and sensitivity analysis: selecting subsets of specifications to study how construction decisions affect factor premia.
- Replication: documenting the exact configuration behind a reported result.
Out-of-Scope Use
- Standalone analysis. The grid contains no return data and must be joined with the Portfolio Returns dataset via the
idcolumn.
Dataset Structure
The repository holds three kinds of Parquet files:
portfolio_sort_grid.parquet: the grid, with 17 columns and 4,105,728 rows.portfolio_sort_grid/<sorting_variable>.parquet(e.g.,portfolio_sort_grid/bm.parquet): the rows of the grid for one sorting variable, at most 23,040 rows or about 115 KB each. Together these slices hold exactly the rows of the grid. They serve clients that need one sorting variable at a time, such as the demo, which runs in the browser.sorting_variables.parquet: one row per sorting variable, with its full name and the direction of its high-minus-low portfolio.
Read the grid by its file name. A reader that loads every Parquet file of the repository mixes the grid with its slices and the list of sorting variables.
Grid columns
Each set of construction choices appears three times, once per weighting scheme, with consecutive ids in the order EW, VW, capped VW.
Invalid combinations are removed: univariate sorts have no size sort, so n_portfolios_secondary is NA, and size itself is not used in bivariate sorts. Specifications whose sort produced no portfolios have no rows in the Portfolio Returns dataset; see its dataset card.
Sorting variable columns
The Open Source Asset Pricing signals are signed so that higher values go with higher expected returns, so every direction is top_minus_bottom.
Dataset Creation
Curation Rationale
Factor construction involves many subjective methodological choices. Rather than committing to a single specification, we enumerate all valid combinations to enable systematic robustness analysis and transparent reporting.
Source Data
Data Collection and Processing
The grid is generated programmatically from the full factorial combination of construction choices, with invalid configurations removed. See 02_define_portfolio_sorts_grid.R in the construction pipeline for the exact generation logic. 05_upload_to_huggingface.R writes the published files: the grid, its slices by sorting variable, and the list of sorting variables.
Who are the source data producers?
The grid is a methodological artifact created by the dataset authors. The sorting variables follow the Open Source Asset Pricing release (Chen and Zimmermann, 2022).
Personal and Sensitive Information
The dataset contains no personal or sensitive information. All columns describe portfolio sorting configurations.
Bias, Risks, and Limitations
- The grid reflects the authors' choice of specification dimensions and does not cover all possible methodological variations (e.g., alternative industry classifications, different minimum listing requirements, or alternative risk-free rate definitions).
- Some specifications may produce portfolios with very few stocks in certain months, particularly for sorting variables with limited coverage or restrictive exclusion criteria.
Recommendations
Always join with the Portfolio Returns dataset via the id column. When reporting results, cite the specific id or the full set of column values to ensure reproducibility.
Citation
BibTeX:
@article{Frey.2026,
title={A Transparent Financial Risk Factor Library},
author={Frey, Christoph and Scheuch, Christoph and Voigt, Stefan and Weiss, Patrick},
year={2026},
journal={Working Paper}
}Dataset Card Authors
Christoph Frey, Christoph Scheuch, Stefan Voigt, Patrick Weiss
Dataset Card Contact
Stefan Voigt (stefan.voigt@econ.ku.dk), Patrick Weiss (patrickw@ru.is)
