Your sales are a time series: level, trend, season and noise.

Before forecasting, you have to look. This chapter explains how the sales of a product look over time and which parts it can be broken into.

One row per day, in order

A time series is simply a list of numbers ordered by date: how much of a product you sold each day, each week or each month. Your sales file contains one series per product (and per warehouse, if you sell from several).

What sets it apart from an ordinary table is that order matters. What you sold yesterday says something about what you will sell tomorrow; what you sold in the same month last year does too. Every forecast relies on that.

The four pieces

Almost any sales history can be read as the sum of four pieces:

  • Level: how much you normally sell. The height of the line.
  • Trend: whether that level is going up or down over time.
  • Season: a pattern that repeats. In daily sales the most common is the weekly one (with more on Fridays and Saturdays); in monthly sales, the yearly one (December, back to school).
  • Noise: what is left over and nobody can predict. A customer who came early, a rainy day.

What can be learned and what cannot

A forecasting model tries to learn the first three pieces and project them forward. Noise, by definition, cannot be learned: you can only measure how much there is, and that tells you how much to trust the forecast (chapter 5 covers that).

Move the simulator: with little noise, the season is visible at a glance. Raise the noise and the same pattern gets lost among the jumps. That is exactly what happens to a model with a very irregular product.

Build a sales series

Simulator

Eight weeks of invented daily sales. Move the knobs and watch how the line changes and how StockAI would classify it.

Sales of the dayWhat can be learned
0.67Seasonal strength
0.28Variation (CV)
SeasonalStockAI would label it

Simulation with invented numbers. The label uses the same rules as StockAI (seasonal strength above 0.3, variation of 1.5), applied to this series.

How StockAI classifies each product

Before training, StockAI looks at the series of each product and attaches one or more labels based on how it sells. The rules are simple and fixed:

  • Short: it has fewer than 20 points of history. With so little, complex models are not trained.
  • Intermittent: 40% or more of the periods have zero sales (chapter 4).
  • Volatile: the variation is very large compared with the average (the coefficient of variation reaches 1.5).
  • Seasonal: the weekly pattern explains a clear part of the variation (a "seasonal strength" above 0.3).
  • Stable: none of the above.

What the label is for

The label decides which models compete for that product. It makes no sense to use a seasonal model for a product that sells twice a month, or one for sporadic sales with one that sells every day. Chapter 3 explains which model goes with which label.

What you take away

  • Your history for each product is a time series: the order of the dates matters.
  • It reads as level, trend, season and noise. The model learns the first three; noise can only be measured.
  • StockAI labels each product (short, intermittent, volatile, seasonal or stable) before choosing models.

Where you see it in StockAI

On each product page, the chart of its history and the label for its sales pattern. When you upload a file, the pre-upload check warns you about products with little history.

Put your own AI to work forecasting your sales. Today.

Three ways to start, depending on how much you want to commit right now. All three lead to the same product.

Create your account

With the whole engine. Upload your sales file and see your first forecast, and with it your first list of what to order.

Create my account

Look before giving your email

An instant trial account with sample data. It lasts 24 hours and is then erased.

Try it without signing up

Talk to us

For the corporate plan, the source code, or to see it with your data and someone beside you. We answer within 24 hours.

Sales and contact: contacto@stockai.es. Phone: +506 7186 2820.

Sales forecasting made in Costa Rica, for companies across Latin America.