Every business decision depends on a guess about the future. Will we have enough cash next month? Will revenue grow or shrink? Should we hire now or wait?
Good forecasts save companies from running out of money, overpaying for inventory, or missing growth opportunities. Machine learning can spot patterns in historical data that humans would miss — and forecast them more accurately.
Before ML, accountants and statisticians used classic time‑series models:
Exponential smoothing gives more weight to recent data than older data. It's simple and surprisingly strong.
ARIMA (Auto‑Regressive Integrated Moving Average) models the pattern in the past values, the trend, and the noise together. It's the workhorse of financial forecasting for decades.
Why learn old methods? Because they're your baseline — if your fancy ML model can't beat ARIMA, it's not actually adding value.
ML treats forecasting as a supervised learning problem. You feed the model "last month's revenue, last 3 months average, day of week," and it learns to predict "next month's revenue."
Random forests build many small decision trees and average their answers. Gradient boosting (like XGBoost or LightGBM) builds trees one at a time, each fixing the previous tree's mistakes. Both are powerful and fast.
For very complex sequences, deep learning shines. LSTM (Long Short‑Term Memory) networks remember patterns across long time windows — great for sales with seasonal cycles.
Transformers, the technology behind ChatGPT, are now used for financial sequences too. They learn which historical moments matter most, then weigh them carefully to predict the future.
Warning: deep learning needs lots of data. For small financial datasets, tree‑based ML usually wins.
Real companies have many levels of forecasting: sales by product, by store, by region, and by company total. If you forecast each one independently, the numbers might not add up — that's a problem!
Hierarchical forecasting solves this by forecasting all levels together and reconciling them. The bottom‑up approach sums the details. The top‑down approach splits the total. Modern methods combine both.
You can't test a forecasting model the same way you test a classifier. You have to respect time. That's backtesting.
Rolling‑origin evaluation works like this: train on months 1–12, predict month 13. Then retrain on 2–13, predict 14. Repeat. It mimics how you'd actually use the model in production — always predicting the future from the past.
Never split randomly for time series. That would leak the future into the past.
A single forecast ("revenue will be $100,000") sounds confident, but reality always has uncertainty. Prediction intervals say "revenue will be between $90,000 and $110,000, 90% of the time."
In finance, this matters enormously. A CFO needs to know the range of possible cash flows, not just a single point. Methods: quantile regression, conformal prediction, or bootstrap ensembles.
Eyeball forecast: Look at a simple 12‑month revenue chart. Write down your guess for the next 3 months. Then compute the average of the last 3 months as a baseline. Compare your guess to the baseline — which is more stable?
Baseline first: Compute a simple "naive forecast": predict next month = this month. Then a "seasonal naive": predict next month = same month last year. Which feels more useful for a toy store at Christmas?
Rolling split demo: Take a toy 12‑month dataset. Split it manually: train on months 1–8, test on 9. Then retrain on 1–9, test on 10. Notice how the training window moves — that's rolling origin.
Uncertainty sense: For a company with very volatile sales (swings wildly) vs. a stable company (steady), which forecast would you trust more? Write a sentence explaining why uncertainty is information.
Hierarchy reconciliation: You forecast three store sales: 100, 200, and 300. The company total should be 600. But your regional model predicts 580. Decide: adjust each store proportionally, or trust one level more? Justify your choice.
Choose a model: For each scenario, pick classical or ML and justify in one sentence: (a) 3 years of monthly data for a small bakery, (b) 10 years of hourly stock data, (c) forecasting 200 store sales with stable patterns.
By the end of this module, you'll be able to: choose the right forecasting model for financial data, explain ARIMA and exponential smoothing, use ML trees and deep learning for time series, backtest with rolling origin, and quantify uncertainty with prediction intervals.