smooth in Python: TBATS implementation

TBATS results on two datasets

TBATS is a popular exponential smoothing model for data with complex seasonality: long seasonal periods, fractional ones (e.g. 52.18 weeks in a year, as I discussed in my previous post), and several of them at once. It models seasonality with harmonics and includes a Box-Cox transformation, ETS level and trend, and ARMA errors (De Livera, … Read more

smooth in Python: iETS and the Croston’s Method

Occurrence ETS model

Is there a statistical model underlying Croston’s method? This question has been bothering researchers for decades. Croston proposed his method back in 1972, and some even argued that there is no sensible model behind it (Shenstone & Hyndman, 2005). Yet there is one! Let me explain. But first, why bother? Because a method just gives … Read more

smooth in Python: fixed probability model for demand occurrence

Example of intermittent demand

When demand is intermittent, one of the most useful forecasts you can produce is not “how much will we sell”, but “how likely are we to sell anything at all”. And this probability can be modelled, just like demand itself. This idea goes back to Croston, who suggested splitting intermittent demand into demand occurrence and … Read more

smooth for Python: Automatic order selection for MSARIMA

Multiple seasonal ARIMA selected for the half-hourly electricity demand series

Have you ever tried to identify ARIMA for your data? The old school Box-Jenkins methodology implies analysing ACF/PACF plots and selecting the orders iteratively. This approach has a fundamental flaw I discussed in one of my earlier posts. Brute force does not help either: even p ≤ 3, d ≤ 2, q ≤ 3 gives … Read more

On differencing of ARIMA in state space

The model fit of MSARIMA

A reader left a comment under the MSARIMA post on LinkedIn saying that in order to compare ARIMAs via information criteria, we need to make sure that the candidate models have the same order of differencing. They are right — for the conventional ARIMA. BUT! In the state space formulation, the problem disappears. Here is … Read more

smooth in python: Multiple Seasonal ARIMA

MSARIMA model fit and point forecast

ARIMA has been a workhorse for decades. But the standard implementations quietly hard-code assumptions: one seasonal cycle, Gaussian errors, regressors handled separately etc. This is fine for textbook well-behaved data. But what do you do when you face real data? The conventional implementations (statsmodels or pmdarima in Python, stats in R) do their job well: … Read more

smooth in python: Multistep losses

Example of fits of ETS with several multistep losses

Why train a forecasting model on one-step-ahead errors when you care about 10-step-ahead accuracy? This is the core motivation behind multistep losses in dynamic models. This has connection with the so-called “direct forecasting strategy”. And here what it is and how to work with it in Python. Conventional maximum likelihood estimation minimises one-step-ahead errors. It … Read more

stick function for the EDA in time series

You have probably seen my post about the STI classification of Hans Levenbach (this one). Well, I’ve decided to implement it, and it has landed in the greybox package for R/Python. What’s greybox? It is a package for statistical modelling focusing on forecasting and time series analysis. I created it back in 2018 to split … Read more

smooth in python: Non-normal distributions in ETS/ARIMA

So, you know quite well that the normal distribution is one of the most popular distributions in statistics. The reasons are manifold, including convenience for the academic community and the fact that it is taught in every single statistics course in the world. But what if we don’t want to be normal? There are situations … Read more