A time series is a sequence of numbers recorded over time, in order. Monthly sales, daily stock prices, hourly cash levels — they all have one thing in common: the order matters.
This is very different from regular data where the order is arbitrary. In a time series, yesterday's values usually tell you something about today's. A good forecasting model respects that connection — it never peeks into the future.
Every time series is a blend of three things:
| Component | What It Means | Example |
|---|---|---|
| 📈 Trend | Long‑term direction | Sales growing every year |
| 🔁 Seasonality | Repeating patterns | More sales every December |
| 🎲 Noise | Random up/down wiggle | Random bad week |
Good forecasts separate the signal (trend + seasonality) from the noise. If you mix them up, you'll overreact to random wiggles.
A moving average smooths out noise by averaging the last N values. Each new period adds a value and drops the oldest. Simple, powerful, and easy to explain.
Exponential smoothing goes further: recent values get more weight than older ones. The model "forgets" slowly, focusing on what's happening right now. It's the workhorse of business forecasting since the 1950s.
ARIMA (Auto‑Regressive Integrated Moving Average) is the Swiss Army knife of time‑series forecasting. It combines three ideas:
AR — yesterday's values predict today's. I — differencing removes trend so you forecast changes, not raw values. MA — past errors predict future corrections.
ARIMA has been the standard in finance and economics for decades. It's interpretable, well‑studied, and often surprisingly strong. A useful baseline before any ML model.
Here's the biggest trap in time series forecasting: if you split data randomly (like other ML problems), your model will "see the future" during training and look amazing — but fail in real life.
The right way: split by time. Train on Jan–Sep, test on Oct. Then retrain on Jan–Oct, test on Nov. Repeat. That's rolling‑origin evaluation: it mimics how you'd actually use the model — predicting the future from the past, again and again.
The three most common financial forecasts:
Revenue: how much will we sell next quarter? Affected by seasonality, marketing, and price.
Expenses: how much will we spend? Usually more predictable — many costs are recurring (rent, salaries).
Cash flow: how much cash will we have? The most critical forecast for small businesses — running out of cash is the #1 reason startups fail, even profitable ones!
You can't improve what you don't measure. Key forecasting metrics:
| Metric | What It Measures | Best For |
|---|---|---|
| MAE | Avg absolute error | Easy to explain to business |
| RMSE | Avg error, punishing big misses | When big errors are costly |
| MAPE | Error as % of actual | Comparing across different scales |
MAPE is popular in business because it says "we're off by 8% on average" — intuitive. But it blows up for values near zero, so use carefully.
Spot the components: Look at a 12‑month revenue chart (real or invented). Which months are the highest? Is there a trend? Is there a repeating pattern? Write one sentence about each: trend, seasonality, noise.
Moving average by hand: Given 6 monthly values (e.g., 100, 120, 110, 130, 140, 150), compute the 3‑month moving average for months 3, 4, 5, and 6. Notice how smoothing makes the numbers less jumpy.
Naive forecast baseline: Write down what a "naive forecast" would be — predicting next month = this month. Then try a "seasonal naive" — predicting next month = same month last year. Which feels smarter for a school supply store?
Rolling split demo: Take 12 months of sales data. Design a 3‑step rolling split: train on M1–M9 / test M10; train on M1–M10 / test M11; train on M1–M11 / test M12. Sketch the training windows.
Cash flow scenario: A bakery's monthly cash flow is +$5,000 in months 1–6, then −$2,000 in months 7–12 (summer slump). What forecast would you give? Why does this matter for business survival?
MAPE math: A forecast says $105k; actual was $100k. What's the absolute error? What's the MAPE? Now do the same with a forecast of $50k vs. actual $45k. Which forecast is "worse" in percentage terms?
By the end of this module, you'll be able to: identify trend, seasonality, and noise; apply moving averages and exponential smoothing; explain ARIMA basics; split time series correctly; and evaluate forecasts with MAE, RMSE, and MAPE.