CoolFace
Datasetpublic

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.

sourceHugging Facecc0-1.0updated 10d agoView on Hugging Face
0likes169downloads
Dataset Card

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

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 id column.

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

ColumnTypeDescription
idint32Specification identifier, the key of the Portfolio Returns dataset
sorting_variablestringSorting characteristic, named like the Open Source Asset Pricing signals (e.g., bm for book-to-market, size for market equity)
min_size_quantiledoubleSize filter: NA (none) or 0.2 (stocks below the 20th NYSE size percentile excluded)
min_stock_pricedoubleMinimum stock price: always NA (not applied)
min_listing_ageint32Minimum listing age in months: always 24
exclude_financialsboolWhether financial firms (SIC 6000-6799) are excluded
exclude_utilitiesboolWhether utility firms (SIC 4900-4999) are excluded
exclude_negative_book_equityboolWhether firms with negative book equity are excluded: always false
exclude_negative_earningsboolWhether firms with negative earnings are excluded
sorting_variable_lagstringLagging convention: 1m (timing of Open Source Asset Pricing), 3m, 6m, or ff (Fama-French)
rebalancingstringRebalancing frequency: monthly or annual (July)
n_portfolios_maindoubleNumber of portfolios in the main sort: 3, 5, or 10
sorting_methodstringunivariate, bivariate-dependent, or bivariate-independent, with size as the second variable of bivariate sorts
breakpoints_min_size_thresholddoubleMinimum size quantile of the stocks that set the main breakpoints: NA (none) or 0.2. It applies to the main breakpoints only; the size breakpoints of bivariate sorts are not screened
n_portfolios_secondarydoubleNumber of size portfolios in bivariate sorts: 2 or 5; NA for univariate sorts
breakpoints_exchangesstringExchanges whose stocks set the breakpoints: NYSE or `AMEX\NASDAQ\NYSE`
weighting_schemestringPortfolio weighting: EW (equal-weighted), VW (value-weighted), or capped VW (value-weighted with market capitalization capped at its 80th percentile each month)

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

ColumnTypeDescription
sorting_variablestringName of the sorting variable, as in the sorting_variable column of the grid
full_namestringDescription of the signal from the Open Source Asset Pricing documentation
directionstringtop_minus_bottom if the high-minus-low portfolio is long the top portfolio and short the bottom one, bottom_minus_top otherwise

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:

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)