TrackRecordWeighting
TrackRecordWeighting(
gap_column='consensus_gap',
surprise_column='surprise',
skill_column=RELATIVE_SKILL_COLUMN,
skill_quantiles=defaults.SKILL_BUCKET_QUANTILES,
winsorize_fraction=defaults.TRACK_RECORD_WINSORIZE_FRACTION,
maximum_absolute_gap=defaults.TRACK_RECORD_MAXIMUM_ABSOLUTE_GAP,
)
Weight the gap by how well the forecaster’s skill tercile has predicted surprise.
Attributes
| gap_column |
str |
Column holding the forecast-consensus gap. |
| surprise_column |
str |
Column holding the realised surprise against consensus. |
| skill_column |
str |
Column holding the trailing skill. |
| skill_quantiles |
tuple[float, float] |
Training quantiles separating the three buckets. |
| winsorize_fraction |
float | None |
Share of each tail of surprise and gap clipped before fitting; None clips nothing. |
| maximum_absolute_gap |
float |
Training rows with a wider gap are left out. |
Methods
| fit |
Fit the cut-offs and the coefficients on training rows alone. |
fit
Fit the cut-offs and the coefficients on training rows alone.
Parameters
| subjects |
pd.DataFrame |
Training rows only, carrying surprise, gap and skill. |
required |
Returns
|
FittedTrackRecordWeighting |
The fitted weighting. |
Raises
|
PanelError |
A column is absent, or no training row survives. |