Demand Forecasting
Demand forecasting is the process of predicting the future demand for a product
Demand forecasting is the process of predicting the future demand for a product
Planning: Plan for future production, inventory, and staffing needs. By accurately forecasting demand, a company can avoid shortages or excess inventory, which can lead to lost sales or increased costs.
Pricing: Demand forecasting can help a company set prices that will maximize profits. For example, if demand is expected to be high, a company may be able to increase prices, while if demand is expected to be low, the company may need to lower prices to attract customers.
Marketing: Optimize your marketing efforts by identifying which products or services are likely to be in high demand and targeting its marketing efforts accordingly.
Resource allocation: Accurate demand forecasting allows a company to allocate resources, such as raw materials, labor, and capital, more efficiently. This can help the company reduce costs and increase profitability.
This example uses a bookings
table to forecast the number of bookings expected for an Airbnb-like company.
forecast_data
CTE is defined as a SELECT statement that selects the booking_date
and total_bookings
columns from the bookings
table. It uses the date
function to extract the date from the booking_time
column and the COUNT
function to count the number of rows in the bookings
table for each unique booking date. It then groups the results by booking_date
.After the forecast_data
CTE is defined, the main SELECT statement selects all columns from the forecast_data
CTE and adds additional columns from a FORECAST
function. The FORECAST
function is used to predict future values based on a historical data set. In this case, it is predicting the future forecast
and trend
values based on the total_bookings
column and the time
column (which is defined as booking_date
).
The final result shows the forecasted demand, as well as the trend of this demand!
This example shows how you can easily understand the uncertainty in your forecast.
It's super simple - all you need to do is look at forecast_lower
(the 10th quantile), forecast
(the median) and forecast_upper
(the 90th quantile). Now you can understand how precise your forecast is!
In this example, we've also extended the horizon to 10000 days, and specifically zoomed in on London... of course, our model is very uncertain with predictions so far in the future!
This example shows how you can easily understand the uncertainty in your trends.
Just like the previous example, you can see how uncertainty affects your trends by looking at trend_lower
(the 10th quantile), trend
(the median) and trend_upper
(the 90th quantile). Now you can understand how precise your trend is!