Time series prediction niceties, where what needs to be predicted is the future.
Filed under *forecasting* because in machine learning terminology, *prediction* is a general term that does not imply extrapolation into the future necessarily.

🏗 handball to Rob Hyndman.

## Recursive estimation

See recursive identification for generic theory of learning under the distribution shift induced by a moving parameter vector.

## Model selection

Rob Hyndman explains how to cross-validate time series models that use only the lagged observations. Cosma Shalizi mentions the sample splitting problem for time series for post-selection inference and has supervised students to do some work with it, notably (Lunde 2019).

For a different emphasis upon the same problem, consider statistical learning theory, or model ensembles in times series.

Or: would we like to try model mixing in this setting? See ensemble methods.

## Training data intake

There is a common pattern with training time series modes that they each predict the next observation from the previous observations, which is not how a classic data loader works in machine learning.
The time at which the future observations are evaluated is the *horizon* and the ones used to make that prediction are the *history*.
For patterns to handle this in neural networks in particular, see Recurrent neural networks.

## Software

Not comprehensive, just noting some useful time series forecasting models/packages as I encounter them. Peter Cotton attempts to collate Popular Python Time Series Packages.

### Tidyverse time series analysis and forecasting packages

A good first stop.

You can find a presentation on these tools by Rob Hyndman.

**tsibble**: Tidy Temporal Data Frames and Tools [CRAN]**tsibbledata**: Example datasets for tsibble [CRAN]**feasts**: Feature Extraction And Statistics for Time Series [CRAN]**fable**: Forecasting Models for Tidy Time Series [CRAN]**sugrrants**: Supporting Graphs for Analysing Time Series. Tools for plotting temporal data using the tidyverse and grammar of graphics framework. [CRAN]**gravitas**: Explore Probability Distributions for Bivariate Temporal Granularities. [CRAN]

### scikit-learn style: Nixtla, sktime, darts

Rob J Hyndman , in Python implementations of time series forecasting and anomaly detection reccommends Nixtla and sktime as good implementations. Nixtla is big! Rob recommends starting from

**statsforecast**: Automatic ARIMA and ETS forecasting**hierarchicalforecast**: Hierarchical forecasting**tsfeatures**: Time series features

Darts (source) (Herzen et al. 2022). aims to be a scikit-learn for time series forecasting. Includes many other algorithms such as prophet, Challu et al. (2022), Oreshkin et al. (2020a) and Salinas, Flunkert, and Gasthaus (2019).

### prophet

prophet (R/Python/Stan):

is a procedure for forecasting time series data. It is based on an additive model where non-linear trends are fit with yearly and weekly seasonality, plus holidays. It works best with daily periodicity data with at least one year of historical data. Prophet is robust to missing data, shifts in the trend, and large outliers.

Commentary:

Is Facebook’s “Prophet” the Time-Series Messiah, or Just a Very Naughty Boy? via Sean J. Taylor on Twitter

This post rips Prophet (a forecasting package I helped create) to shreds and I agree with most of it🥲. I always suspected the positive feedback was mostly from folks who’d had good results—conveniently the author has condensed many bad ones into one place.

### Silverkite

Hosseini et al. (2021)

The Greykite library provides flexible, intuitive and fast forecasts through its flagship algorithm, Silverkite.

Silverkite algorithm works well on most time series, and is especially adept for those with changepoints in trend or seasonality, event/holiday effects, and temporal dependencies. Its forecasts are interpretable and therefore useful for trusted decision-making and insights.

The Greykite library provides a framework that makes it easy to develop a good forecast model, with exploratory data analysis, outlier/anomaly preprocessing, feature extraction and engineering, grid search, evaluation, benchmarking, and plotting. Other open source algorithms can be supported through Greykite’s interface to take advantage of this framework, as listed below.

### Causal impact

🏗 find out how Causal impact works. (Based on Brodersen et al. (2015).)

### asap

asap:

Automatic Smoothing for Attention Prioritization in Time Series

ASAP automatically smooths time series plots to remove short-term noise while retaining large-scale deviations.

## Makridakis competitions

The M4 dataset is a collection of 100,000 time series used for the fourth edition of the Makridakis forecasting Competition. The M4 dataset consists of time series of yearly, quarterly, monthly and other (weekly, daily and hourly) data, which are divided into training and test sets. The minimum numbers of observations in the training test are 13 for yearly, 16 for quarterly, 42 for monthly, 80 for weekly, 93 for daily and 700 for hourly series. The participants were asked to produce the following numbers of forecasts beyond the available data that they had been given: six for yearly, eight for quarterly, 18 for monthly series, 13 for weekly series and 14 and 48 forecasts respectively for the daily and hourly ones.

- M4 Dataset | Papers With Code
- Mcompetitions/M4-methods: Data, Benchmarks, and methods submitted to the M4 forecasting competition
- M4 Forecasting Competition | Rob J Hyndman
- M4 – MOFC

Now we are up to M5 and M6 is cooking.

## Micropredictions.org

micropredictions is a quixotic project my colleagues have forwarded to me. Included here as a spur. The micropredictions FAQ says:

What’s microprediction you say?

The act of making thousands of predictions of the same type over and over again. Microprediction can

- Clean and enrich live data
- Alert you to outliers and anomalies
- Provide you short term forecasts
- Identify patterns in model residuals
Moreover it can be combined with patterns from Control Theory and Reinforcement Learning to

- Engineer low cost but tailored intelligent applications
Often enough

AI is microprediction, albeit bundled with other mathematical or application logic.

- You publish a live data value.
- The sequence of these values gets predicted by a swarm of algorithms.
- Anyone can write a crawler that tries to predict many different streams.
Microprediction APIs make it easy to:

- Separate the act of microprediction from other application logic.
- Invite contribution from other people and machines
- Benefit from other data you may never have considered.
… Let’s say your store is predicting sales and I’m optimizing an HVAC system across the street. Your feature space and mine probably have a lot in common.

I am unclear how the datastreams as set up incorporates domain knowledge and private side information, which seems the hallmark of natural intelligence and, e.g. science.
Perhaps they feel domain knowledge is a bug standing in the way of truly general artificial intelligence?
If I had free time I might try to get a better grip on what they are doing, whoever *they* are.

Alternatively, they are coming at this from a chartist quant perspective and data are best considered as sort-of-anonymous streams of numbers, the better to attract disinterested competition.

## References

*arXiv:1802.09064 [Cs, Stat]*, February.

*Dependence Modeling*1: 65–93.

*Bernoulli*.

*IEEE transactions on neural networks and learning systems*27 (1): 62–76.

*Computational Statistics & Data Analysis*120 (April): 70–83.

*Computational Learning Theory*, edited by David Helmbold and Bob Williamson, 31–47. Lecture Notes in Computer Science. Berlin, Heidelberg: Springer.

*Time Series Analysis: Forecasting and Control*. Fifth edition. Wiley Series in Probability and Statistics. Hoboken, New Jersey: John Wiley & Sons, Inc.

*The Annals of Applied Statistics*9 (1): 247–74.

*Automatic Autocorrelation and Spectral Analysis*. Secaucus, NJ, USA: Springer.

*International Journal of Mathematics and Mathematical Sciences*2006 (August): e19423.

*arXiv:2201.12886 [Cs]*, February.

*Journal of the Royal Statistical Society: Series B (Statistical Methodology)*62 (3): 493–508.

*Journal of Economic Surveys*21 (4): 746–85.

*An Introduction to State Space Time Series Analysis*. 1 edition. Oxford ; New York: Oxford University Press.

*Journal of Statistical Software*41 (1).

*Scandinavian Journal of Statistics*8 (2): 93–115.

*arXiv:1903.03986 [Cs, Stat]*, March.

*IEEE Signal Processing Magazine*35 (6): 16–34.

*Finite Mixture and Markov Switching Models*. Springer Series in Statistics. New York: Springer.

*Bayesian Analysis*5 (2).

*Nature*435 (7040): 328–31.

*Journal of Time Series Analysis*1 (1): 15–29.

*Journal of Machine Learning Research*23 (124): 1–6.

*arXiv:2105.01098 [Stat]*, May.

*Journal of Computational and Graphical Statistics*10 (1): 82–89.

*Statistica Sinica*13 (4): 1097–1118.

*International Journal of Forecasting*, Forecasting Long Memory Processes, 18 (2): 167–79.

*International Journal of Forecasting*, M4 Competition, 36 (1): 7–14.

*Advances in Neural Information Processing Systems*, 541–49. Curran Associates, Inc.

*arXiv:1902.07425 [Math, Stat]*, February.

*arXiv:1711.02834 [Math, Stat]*, November.

*International Journal of Forecasting*, M4 Competition, 36 (1): 54–74.

*Advances in Water Resources*28 (2): 135–47.

*The Annals of Statistics*24 (1): 370–79.

*Journal of Machine Learning Research*21 (166): 1–52.

*arXiv:1905.10437 [Cs, Stat]*, February.

*Journal of Business & Economic Statistics*5 (3): 389–95.

*Time series: modeling, computation, and inference*. Second edition. Texts in statistical science. Boca Raton London New York: CRC Press, Taylor & Francis Group.

*Physical Review E*91 (5).

*arXiv:0912.4883 [Cs, Math, Stat]*, December.

*arXiv:1704.04110 [Cs, Stat]*, February.

*Nonlinear Dynamics and Statistics*.

*arXiv:0907.4290 [Physics]*2 (1).

*Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences*348 (1688): 477.

*PMLR*, 3348–57.

*Quantitative Finance*18 (1): 1–5.

*Journal of Financial Econometrics*6 (3): 382–406.

*arXiv:1504.06706 [Math, Stat]*, April.

*International Journal of Forecasting*31 (3): 980–91.

*arXiv:1711.11053 [Stat]*, November.

*Neural Networks*1 (4): 339–56.

*Annals of Geophysics*, no. 3 (November).

*Journal of Computational and Graphical Statistics*20 (1): 174–95.

*Proceedings of the 9th International Conference on Neural Information Processing Systems*, 309–15. NIPS’96. Cambridge, MA, USA: MIT Press.

## No comments yet. Why not leave one?