The Menace of ML: Simple Moving Average

Simple Moving Average of order 8

And here is another forecasting method that is hard to beat in practice. In a recent competition, it gave data scientists huge headaches and even outperformed some powerful ML methods. What’s the name of this beast?! Simple Moving Average! The idea behind the Simple Moving Average (SMA) is to take the average of the last … Read more

Five assumptions behind “forecastability”

Example of two time series with exactly the same coefficient of variation

Here is a confession. I don’t like the idea of “forecastability”. I think it does not bring value and can be harmful in some cases. Let me explain. One of the definitions I see on the internet: “A measure of the degree to which something may be forecast with accuracy”. This definition is so disturbing … 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

Another important Naïve method

Seasonal Naive depiction

There is another forecasting method that is extremely popular, hard to beat, and has no parameters to estimate. It also has “Naïve” in its name. Do you know what I’m talking about? It is called “Seasonal Naïve”. While the simple Naïve copies the last observed actual into the future as a forecast, the seasonal one … 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

Why Naïve is popular and important

How Naive works

There is one forecasting method that appears more often than any other in competitions and evaluations. An experienced forecaster will always use it as a benchmark. This method is called “Naïve”, and here is why it is popular and important. Naïve is a very simple forecasting method: the forecast equals to the last observed value. … 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

Hans Levenbach’s classification scheme for trend/seasonal components

Seasonal profile of the data

Here is a curious idea: if we can somehow estimate the importance of trend/seasonal components for your data, you can use this in model building and forecasting. But how can we do this first step? Hans Levenbach has an answer with his simple EDA technique. Let me explain. The core idea is simple and neat. … Read more

smooth in python: multiple seasonal ETS

Another interesting case in demand forecasting is the high frequency data. For example, if you work with demand on daily level, you might notice that demand increases every Monday but also exhibits proper seasonal fluctuations (e.g. decline every Winter). What do you do in this case? One of the solutions (old but gold) is the … Read more