Demand forecasting for purchasing: from past sales to the purchase order.

Forecasting demand is not guessing the future: it is estimating how much of each product will sell during the time an order takes to arrive, with the margin of error in view. This guide explains how that forecast is used to buy better, and how StockAI does it.

What forecasting is for in purchasing

The forecast is the input to almost every purchasing decision: the reorder point, the safety stock and the quantity to order all depend on how much is expected to sell. A flat average works while demand is stable; it fails with seasons, trends, promotions or sales that come in bursts.

Why one method is not enough

Not every product sells the same way. A stable one forecasts well with a simple model; a seasonal one needs a model that understands the calendar; an intermittent one, with many zero periods, needs models built for that. That is why StockAI classifies each product by how it sells (stable, seasonal, intermittent or volatile) and makes up to nine models compete, product by product: LightGBM, XGBoost, ARIMA, SARIMAX, Prophet, ETS, Croston, an LSTM neural network and a global model that learns from the whole catalogue.

How the winning model is chosen

  • Each model has a stretch from the end of your history hidden and is asked to forecast it, in several cuts. That measures it against data it did not see.
  • The winner is chosen with a cost in which running out weighs three times more than having extra, because in purchasing a stockout and an excess do not cost the same.
  • It has to beat two naive forecasts: repeating the last value and repeating the previous season. If it does not, a complex model is not justified.
  • The winner is retrained on the full history and projects demand with a probable range around it, not a single number.

From forecast demand to the purchase

The forecast is not the end. It is crossed with stock, what is on its way and the supplier’s lead time to give the reorder point, the stock signal and the suggested quantity. That part is explained in how to calculate the reorder point and safety stock. The full walkthrough, with screenshots, is in how StockAI works.

The limits, said up front

  • A product with fewer than 20 periods of history is left out of the forecast and shown as SIN DATOS (no data): no number is invented for it.
  • The range is not a guarantee: it is the band where sales will probably fall.
  • It cannot guess what never happened. A new promotion or a new large customer is tried in the scenario simulator.
  • The colour of the stock signal is decided by a published rule, not the model: AI forecasts and the rule decides.
  • It does not buy for you: it suggests, and you send the order.

How to measure whether a forecast is good

On dates the model did not see, product by product, and against what actually sold afterwards. StockAI shows each product’s error, not one percentage for the whole catalogue, and does not publish a marketing accuracy figure: the one you see is your data’s.

Frequently asked questions about demand forecasting

What history do I need to forecast?

At least 20 periods per product, in a CSV or Excel file with date, product and quantity sold.

Which models does StockAI use?

Up to nine: LightGBM, XGBoost, ARIMA, SARIMAX, Prophet, ETS, Croston, an LSTM network and a global model. They compete per product and the one whose mistakes cost least wins.

What about a new promotion?

The model cannot know what never happened. It is tried in the scenario simulator, which shows what changes in the purchase.

How often is the forecast updated?

Whenever you upload new sales, or on a scheduled recalculation: weekly, daily, business days only, hourly or monthly.

And to see the product

Upload your history and see each product’s forecast and error.

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.