Skip to content

v1.4.1: quantile forecasts and count distributions

Choose a tag to compare

@yallioux yallioux released this 08 Oct 21:10
· 70 commits to main since this release
1d93905

Patch release for probabilistic forecasting: new methods and options only, plus one fix. Existing calls give the same forecasts; the only change of behaviour is that a distributional or mixture StaticTAM with the default log target now raises on a training target with values <= 0 instead of returning a meaningless model.

DOI of this version: https://doi.org/10.5281/zenodo.23248249 (all versions: https://doi.org/10.5281/zenodo.20543271).

Fixed

  • Log target with values <= 0: a distributional or mixture StaticTAM with the default log target raises a ValueError naming the count and dist_kwargs={"log_target": False}. Such values were clipped to 1e-12 before the log, which turned them into huge negative outliers: the fitted scale collapsed to 1e-10 or exploded to 1e60. Positive targets are unchanged.

Quantile forecasts

  • AdaptiveTAM.predict_quantiles(data, taus): the scale of a distributional base is renewed online from the standardized residuals of the last window, past residuals only.
  • KalmanTAM.predict_quantiles(data, taus): Gaussian quantiles from the predictive variance of the filter, also for a multi-step horizon.
  • SafetyTAM.predict_quantiles(y_pred, levels, signed=...): conformal quantiles at several levels, with a signed per-tail calibration for skewed errors; calibrate(..., verbose=False) silences the sample-count line.
  • OperaTAM(..., loss_type='pinball', tau=...) and tam.model.opera.aggregate_quantiles: online aggregation of quantile forecasts (MLpol and EWA).

All of them return a DataFrame with q<tau> columns, like the distributional StaticTAM.

Distributions

  • dist_kwargs={"target_transform": "asinh" | "logit"} for the distributional StaticTAM: skewed targets with negative values (prices) and targets bounded in an interval, with exact back-transformed quantiles. "log" stays the default.
  • loss="negative_binomial" and loss="tweedie" (log link): overdispersed counts, and positive targets with exact zeros. The dispersion is estimated (model.dispersion_); predict_quantiles gives discrete quantiles for counts (also for poisson) and the quantiles of the compound Poisson-gamma law for Tweedie, never below zero.
  • f(x, ..., period=None | 'auto' | (low, high)): the range of one cycle of a Fourier input (hours 0-23, days 0-6, months 1-12, or a history that covers part of the cycle). The default is unchanged.

Also

  • Limiting the CPU threads through OMP_NUM_THREADS and MKL_NUM_THREADS is documented and tested. A hang after torch.set_num_threads(n) seen on one PyTorch / oneMKL build also occurs without tam; the results of tam are unchanged.
  • A DCO sign-off is required on pull requests, and a REUSE check runs in CI.

Known limits: with a distributional base, the columns of AdaptiveTAM.predict_online carry the internal name __mu__; the Kalman variance after a long gap of missing targets is understated (inherited from the filter).

The full list is in CHANGELOG.md.