--- title: "How does forecasting work?" slug: "how-does-forecasting-work" updated: 2022-08-17T09:40:51Z published: 2022-08-17T09:40:51Z canonical: "docs.scaleinsights.com/how-does-forecasting-work" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.scaleinsights.com/llms.txt > Use this file to discover all available pages before exploring further. # How does forecasting work? 1. The system calculates the amount to restock (**Amount to Restock**) by multiplying daily sales velocity with total lead time. It calculates the number of stocks to reserve/buffer (**Buffer Stock**) by multiplying daily sales velocity with days of stock to reserve (**Buffer Days**). ![1.png](https://cdn.document360.io/f0238742-849b-4f29-9812-9b4fe8e273b6/Images/Documentation/1.png) 2. If the daily velocity is 20 units/day and the total lead time is 25 days, the system will recommend ordering 500 units during restocking (**Amount to Restock**). ![2.png](https://cdn.document360.io/f0238742-849b-4f29-9812-9b4fe8e273b6/Images/Documentation/2.png) 3. If you want to reserve/buffer 10 days of stocks to mitigate unexpected delays or increase in sales, the algorithm will attempt to reserve/buffer 200 units at the lowest point (**Buffer Stock**). It will recommend restocking the day when the stock level reaches 700 units (**Amount to Restock +** **Buffer Stock**). ![3.png](https://cdn.document360.io/f0238742-849b-4f29-9812-9b4fe8e273b6/Images/Documentation/3.png) --- #### **Restocking Timeline** 1. Assume 25 days lead time, 20 units/day, and 200 units of reserved stock (**Buffer Stock**). The system will recommend restocking when 700 units are left. ![4.png](https://cdn.document360.io/f0238742-849b-4f29-9812-9b4fe8e273b6/Images/Documentation/4.png) 2. 1 day before stock arrives, there will be 220 units left (assuming daily velocity remains the same). ![5.png](https://cdn.document360.io/f0238742-849b-4f29-9812-9b4fe8e273b6/Images/Documentation/5.png) 3. Stock arrives on the 26th day, bringing the total stock level to 700 units. The system will recommend restocking since 700 units are left. ![6.png](https://cdn.document360.io/f0238742-849b-4f29-9812-9b4fe8e273b6/Images/Documentation/6.png)