timemachines

Skaters

View as web page or source.

What’s a “skater”, abstractly?

A skater is a function suggesting a state machine for sequential assimilation and forecasting (hence the name timemachines).

\[f : (y_t, state; k) \mapsto ( [\hat{y}(t+1),\hat{y}(t+2),\dots,\hat{y}(t+k) ], [\sigma(t+1),\dots,\sigma(t+k)], posterior\ state))\]

where $\sigma(t+l)$ estimates the standard error of the prediction $\hat{y}(t+l)$. (This looks better in the source code btw.)

If you prefer an legit (stateful) state machine, see FAQ question 1.

See interface for description of input and output arguments.

Finding a skater

Poke around in /skaters.

Package Location Comment
StatsModels.TSA skaters/tsa  
DARTS skaters/drts  
SkTime skaters/sk  
StatsForecast Also in sktime, for now  
TBATS skaters/bats  
PMD skaters/sk  
Prophet skaters/proph A sine from god
NeuralProphet skaters/nproph  
KATS skaters/kts  
GreyKite skaters/gk  
Orbit-ML skaters/orbt  
PyCaret skaters/pycrt  
River skaters/rvr Flowing
Divinity skaters/divine  
PyDLM skaters/pydlm  
PyFlux skaters/flux  
GluonTS skaters/glu  
Merlion skaters/mrln  

And some home grown

Package Location Remark
Simple skaters/simple  
SMDK skaters/smdk  
Elo skaters/elo Future-proof

and maybe more (see here).

Importing a skater

Examples:

from timemachines.skaters.sk.skautoarima import sk_autoarima as f
from timemachines.skaters.simple.hypocraticensemble import quick_balanced_ema_ensemble as f

Or do it by name, which can be less efficient:

from timemachines.skaters.localskaters import local_skater_from_name
f = local_skater_from_name('rvr_p1_d0_q0')

The names of skaters appear on the Elo ratings tables.

Using a skater

“Skater” is a nmemonic for the non-data arguments (see interface) although you might need only the first two, s (state) and k (steps ahead). The script skating.py illustrates the usage pattern. Like so:

from timemachines.skaters.simple.thinking import thinking_slow_and_fast as f
import numpy as np
y = np.cumsum(np.random.randn(1000))
s = {}
x = list()
for yi in y:
    xi, xi_std, s = f(y=yi, s=s, k=3)
    x.append(xi)

There’s more in examples/basic_usage.

Skater arguments and return values

Again, see the skater interface documentation for more details about expectations placed on skater functions.

-+-

Documentation map

skating