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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pretty_name: Tidy Finance Factor Library Specification Grid
|
| 3 |
+
license: mit
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
tags:
|
| 7 |
+
- finance
|
| 8 |
+
- asset-pricing
|
| 9 |
+
- factor-models
|
| 10 |
+
- portfolio-sorts
|
| 11 |
+
- empirical-finance
|
| 12 |
+
size_categories:
|
| 13 |
+
- 100K<n<1M
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# Tidy Finance Factor Library: Specification Grid
|
| 17 |
+
|
| 18 |
+
Lookup table mapping specification IDs to portfolio sorting configurations. Use this dataset together with the [Portfolio Returns](https://huggingface.co/datasets/tidy-finance/portfolio-returns) dataset to identify the methodological choices behind each factor return series.
|
| 19 |
+
|
| 20 |
+
## Dataset Details
|
| 21 |
+
|
| 22 |
+
### Dataset Description
|
| 23 |
+
|
| 24 |
+
The dataset contains approximately 180,000 unique specification paths for constructing long-short portfolio returns. Each row defines a complete set of preprocessing and sorting choices (sample exclusions, lagging convention, breakpoint definition, weighting scheme, rebalancing frequency). The `id` column links to the corresponding return series in the Portfolio Returns dataset.
|
| 25 |
+
|
| 26 |
+
- **Curated by:** Christoph Frey (Lancaster University), Christoph Scheuch (Tidy Intelligence), Stefan Voigt (University of Copenhagen), Patrick Weiss (Reykjavík University)
|
| 27 |
+
- **Funded by:** Danish Finance Institute
|
| 28 |
+
- **License:** MIT
|
| 29 |
+
|
| 30 |
+
### Dataset Sources
|
| 31 |
+
|
| 32 |
+
- **Repository:** [https://github.com/tidy-finance/jss-multilingual-factor-library](https://github.com/tidy-finance/jss-multilingual-factor-library)
|
| 33 |
+
- **R package:** [https://github.com/tidy-finance/r-tidyfinance](https://github.com/tidy-finance/r-tidyfinance)
|
| 34 |
+
- **Python package:** [https://github.com/tidy-finance/py-tidyfinance](https://github.com/tidy-finance/py-tidyfinance)
|
| 35 |
+
- **Demo:** [https://app-download-center.cloud.sdu.dk/](https://app-download-center.cloud.sdu.dk/)
|
| 36 |
+
|
| 37 |
+
## Uses
|
| 38 |
+
|
| 39 |
+
### Direct Use
|
| 40 |
+
|
| 41 |
+
- Joining with the Portfolio Returns dataset to filter or group factor returns by specific methodological choices.
|
| 42 |
+
- Robustness and sensitivity analysis: selecting subsets of specifications to study how preprocessing decisions affect factor premia.
|
| 43 |
+
- Replication: documenting the exact configuration behind a reported result.
|
| 44 |
+
|
| 45 |
+
### Out-of-Scope Use
|
| 46 |
+
|
| 47 |
+
- Standalone analysis. The grid contains no return data and must be joined with the Portfolio Returns dataset via the `id` column.
|
| 48 |
+
|
| 49 |
+
## Dataset Structure
|
| 50 |
+
|
| 51 |
+
The dataset consists of a single Parquet file with 13 columns and approximately 180,000 rows.
|
| 52 |
+
|
| 53 |
+
<table>
|
| 54 |
+
<thead>
|
| 55 |
+
<tr>
|
| 56 |
+
<th>Column</th>
|
| 57 |
+
<th>Type</th>
|
| 58 |
+
<th>Description</th>
|
| 59 |
+
</tr>
|
| 60 |
+
</thead>
|
| 61 |
+
<tbody>
|
| 62 |
+
<tr>
|
| 63 |
+
<td><code>id</code></td>
|
| 64 |
+
<td>int32</td>
|
| 65 |
+
<td>Unique specification identifier, foreign key to the Portfolio Returns dataset</td>
|
| 66 |
+
</tr>
|
| 67 |
+
<tr>
|
| 68 |
+
<td><code>sorting_variable</code></td>
|
| 69 |
+
<td>string</td>
|
| 70 |
+
<td>Sorting characteristic (e.g., <code>sv_ag</code> for asset growth, <code>sv_bm</code> for book-to-market)</td>
|
| 71 |
+
</tr>
|
| 72 |
+
<tr>
|
| 73 |
+
<td><code>exclude_size</code></td>
|
| 74 |
+
<td>double</td>
|
| 75 |
+
<td>Size exclusion threshold: <code>0</code> (none) or <code>0.2</code> (bottom 20th NYSE percentile)</td>
|
| 76 |
+
</tr>
|
| 77 |
+
<tr>
|
| 78 |
+
<td><code>exclude_financials</code></td>
|
| 79 |
+
<td>bool</td>
|
| 80 |
+
<td>Whether financial firms (SIC 6000-6799) are excluded</td>
|
| 81 |
+
</tr>
|
| 82 |
+
<tr>
|
| 83 |
+
<td><code>exclude_utilities</code></td>
|
| 84 |
+
<td>bool</td>
|
| 85 |
+
<td>Whether utility firms (SIC 4900-4999) are excluded</td>
|
| 86 |
+
</tr>
|
| 87 |
+
<tr>
|
| 88 |
+
<td><code>exclude_negative_earnings</code></td>
|
| 89 |
+
<td>bool</td>
|
| 90 |
+
<td>Whether firms with negative earnings are excluded</td>
|
| 91 |
+
</tr>
|
| 92 |
+
<tr>
|
| 93 |
+
<td><code>sorting_variable_lag</code></td>
|
| 94 |
+
<td>string</td>
|
| 95 |
+
<td>Lagging convention: <code>3m</code>, <code>6m</code>, or <code>ff</code> (Fama-French)</td>
|
| 96 |
+
</tr>
|
| 97 |
+
<tr>
|
| 98 |
+
<td><code>rebalancing</code></td>
|
| 99 |
+
<td>string</td>
|
| 100 |
+
<td>Rebalancing frequency: <code>monthly</code> or <code>annual</code> (July)</td>
|
| 101 |
+
</tr>
|
| 102 |
+
<tr>
|
| 103 |
+
<td><code>breakpoints_main</code></td>
|
| 104 |
+
<td>double</td>
|
| 105 |
+
<td>Number of quantile portfolios for the primary sort: <code>5</code> or <code>10</code></td>
|
| 106 |
+
</tr>
|
| 107 |
+
<tr>
|
| 108 |
+
<td><code>sorting_method</code></td>
|
| 109 |
+
<td>string</td>
|
| 110 |
+
<td>Sorting method: <code>univariate</code>, <code>bivariate-dependent</code>, or <code>bivariate-independent</code></td>
|
| 111 |
+
</tr>
|
| 112 |
+
<tr>
|
| 113 |
+
<td><code>breakpoints_secondary</code></td>
|
| 114 |
+
<td>double</td>
|
| 115 |
+
<td>Number of quantile portfolios for the secondary sort (size): <code>2</code>, <code>5</code>, or <code>NA</code> for univariate sorts</td>
|
| 116 |
+
</tr>
|
| 117 |
+
<tr>
|
| 118 |
+
<td><code>breakpoints_exchanges</code></td>
|
| 119 |
+
<td>string</td>
|
| 120 |
+
<td>Exchanges used for breakpoint computation: <code>NYSE</code> or <code>AMEX|NASDAQ|NYSE</code></td>
|
| 121 |
+
</tr>
|
| 122 |
+
<tr>
|
| 123 |
+
<td><code>weighting_scheme</code></td>
|
| 124 |
+
<td>string</td>
|
| 125 |
+
<td>Portfolio weighting: <code>EW</code> (equal-weighted) or <code>VW</code> (value-weighted)</td>
|
| 126 |
+
</tr>
|
| 127 |
+
</tbody>
|
| 128 |
+
</table>
|
| 129 |
+
|
| 130 |
+
## Dataset Creation
|
| 131 |
+
|
| 132 |
+
### Curation Rationale
|
| 133 |
+
|
| 134 |
+
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.
|
| 135 |
+
|
| 136 |
+
### Source Data
|
| 137 |
+
|
| 138 |
+
#### Data Collection and Processing
|
| 139 |
+
|
| 140 |
+
The grid is generated programmatically from the full factorial combination of preprocessing choices, with invalid configurations removed (e.g., univariate sorts have no secondary breakpoints; market equity is excluded from bivariate sorts where size is the secondary variable; earnings-to-market excludes configurations that allow negative earnings). See `code/01_define_portfolio_sorts_grid.R` in the companion repository for the exact generation logic.
|
| 141 |
+
|
| 142 |
+
#### Who are the source data producers?
|
| 143 |
+
|
| 144 |
+
The grid is a methodological artifact created by the dataset authors. No external data sources are involved.
|
| 145 |
+
|
| 146 |
+
### Personal and Sensitive Information
|
| 147 |
+
|
| 148 |
+
The dataset contains no personal or sensitive information. All columns describe portfolio sorting configurations.
|
| 149 |
+
|
| 150 |
+
## Bias, Risks, and Limitations
|
| 151 |
+
|
| 152 |
+
- 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).
|
| 153 |
+
- Some specifications may produce portfolios with very few stocks in certain months, particularly for smaller sorting variables or restrictive exclusion criteria.
|
| 154 |
+
|
| 155 |
+
### Recommendations
|
| 156 |
+
|
| 157 |
+
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.
|
| 158 |
+
|
| 159 |
+
## Citation
|
| 160 |
+
|
| 161 |
+
**BibTeX:**
|
| 162 |
+
|
| 163 |
+
```bibtex
|
| 164 |
+
@article{frey2026transparent,
|
| 165 |
+
title={A Transparent Financial Risk Factor Library},
|
| 166 |
+
author={Frey, Christoph and Scheuch, Christoph and Voigt, Stefan and Weiss, Patrick},
|
| 167 |
+
year={2026},
|
| 168 |
+
journal={Working Paper}
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
Dataset Card Authors
|
| 172 |
+
Christoph Frey, Christoph Scheuch, Stefan Voigt, Patrick Weiss
|
| 173 |
+
|
| 174 |
+
Dataset Card Contact
|
| 175 |
+
Stefan Voigt (stefan.voigt@econ.ku.dk), Patrick Weiss (patrickw@ru.is)
|