Decision Atlas
ANLAnalytics & AIStop 1 of 6
  1. Statistics you will actually use
  2. Optimization basics: LP and MILP
  3. Simulation & Monte Carlo
  4. Machine learning in supply chain
  5. AI agents, RAG & copilots
  6. AI + optimization

Statistics you will actually use

Averages, spread, box plots, outliers and stationarity, the handful of statistics behind most supply chain analysis.

3 min gist, 10 min in full Draft, review pending

Read atChange any time

Centre, spread, outliers and whether the pattern stays put.

Most supply chain analysis rests on a few statistical ideas.

Centre: mean or median? Eleven days of sales for one item: 10, 11, 12, 13, 14, 14, 15, 16, 17, 18 and 45. The mean is about 16.8, pulled up by one bulk order of 45. The median, the middle value, is 14 and better describes a normal day. When data has spikes, look at both.

Spread: the standard deviation measures how far values typically stray from the mean. The coefficient of variation (standard deviation ÷ mean) makes spread comparable across items with different volumes, which is why it’s used for XYZ classification.

Box plots and outliers: a box plot shows the middle half of the data (from the first quartile Q1 to the third quartile Q3) as a box, with the median inside. The box’s height is the interquartile range (IQR). A common rule flags values beyond 1.5 × IQR outside the box as outliers. For the sales above, Q1 ≈ 12 and Q3 ≈ 17, so IQR ≈ 5 and anything above about 24.5 is flagged: the 45 stands out. Other methods include z-scores (beyond ±3 standard deviations) and robust versions based on the median.

An outlier isn’t automatically an error. A one-off bulk order should be removed before forecasting baseline demand; a genuine new trend shouldn’t.

Stationarity: a time series is stationary when its average level and its variability stay roughly constant over time. Many forecasting models assume it. Trends and seasonality break it, so analysts plot rolling averages and rolling standard deviations, use formal tests such as the augmented Dickey-Fuller (ADF) test, and transform the data, by differencing or taking logs, until it’s stable.

Univariate vs multivariate: univariate analysis looks at one variable, like sales history alone; multivariate looks at several together, such as sales, price and promotions. Remember that correlation isn’t causation.

Words to use

Interquartile range (IQR)
Q3 − Q1: the spread of the middle half of the data.
Outlier
A value far from the rest, flagged by a rule such as 1.5 × IQR beyond the quartiles.
Stationarity
Constant mean and variance over time; often needed before modelling.

The gist's sales data worked through: robust outlier checks, how one spike changes an item's class, and a simple price regression.

One spike, many effects

Take the eleven days of sales from the gist: 10, 11, 12, 13, 14, 14, 15, 16, 17, 18 and 45.

Worked example: what the 45 does to the numbers
MeasureWith the 45Without it
Mean16.814.0
Standard deviation9.662.58
Coefficient of variation0.58 (class Y)0.18 (class X)
  • The z-score test misses it: (45−16.8)/9.66≈2.9(45 - 16.8)/9.66 \approx 2.9, under the usual cut-off of 3, because the spike has inflated the standard deviation it is measured against. This is called masking.
  • A robust test catches it: use the median (14) and the median absolute deviation (MAD). The absolute deviations from 14 have a median of 2, so the robust z-score is 0.6745×(45−14)/2≈10.50.6745 \times (45 - 14)/2 \approx 10.5, far beyond any threshold.
  • One spike changes the class: the item’s coefficient of variation jumps from 0.18 to 0.58, moving it from X (steady) to Y (variable) and inflating its safety stock.

The lesson: check for outliers with robust measures (median, MAD, IQR), decide whether each one is a real part of demand, and only then compute the statistics that drive policies.

Relationships: correlation and regression

Weekly sales of a product at five price points:

Price (₹)10095908580
Sales200215236250270

A straight-line fit gives sales ≈ 549.2 − 3.5 × price, so each ₹1 cut adds about 3.5 units a week. The correlation is −0.998, very strong. At the average price and sales, the price elasticity is −3.5 × 90 / 234.2 ≈ −1.35: a 1% price cut raises sales by about 1.35%.

Distributions that come up again and again

  • Normal: sums of many small effects, such as demand over a lead time for steady items. The basis of z-values in safety stock.
  • Poisson: counts of rare, independent events, such as spare-part demand or breakdowns.
  • Lognormal and other skewed shapes: lead times and repair times, which can’t go below zero but have long right tails.

Testing stationarity properly, autocorrelation, spurious correlation and Simpson's paradox, and the difference between significant and important.

Testing stationarity

Two common tests have opposite starting assumptions, which is why they are often used together:

  • ADF (augmented Dickey-Fuller): assumes the series has a unit root (it wanders without returning to a mean). A small p-value rejects that, suggesting stationarity.
  • KPSS: assumes the series is stationary. A small p-value rejects that, suggesting it isn’t.

If ADF says stationary and KPSS agrees, fine; if they disagree, look at the plot and consider trend-stationary versus difference-stationary behaviour. Fixes include differencing (working with changes rather than levels), seasonal differencing (this month minus the same month last year) and log or Box-Cox transforms to stabilize variance that grows with the level.

Autocorrelation

The autocorrelation function (ACF) shows how strongly a series is related to its own past values at each lag. A spike at lag 12 in monthly data signals yearly seasonality; slowly decaying autocorrelation suggests a trend or a unit root. The partial autocorrelation (PACF) helps choose ARIMA model orders. Autocorrelated forecast errors are a sign that a model has missed a pattern.

Correlation traps

  • Spurious correlation: two series that both trend over time (say, sales of a product and the population of a city) will correlate strongly even with no link. Granger and Newbold (1974) showed how regressions between unrelated trending series produce misleadingly “significant” results. Difference the series or model the trend first.
  • Simpson’s paradox: a pattern in the total can reverse within every group. Overall, faster carriers might seem to have more damage, but within each product type they have less, because they carry more fragile goods. Always check results within relevant segments.
  • Causation: a correlation between promotions and sales doesn’t measure the promotion’s effect if promotions were run when sales were expected to rise anyway. Controlled experiments or careful causal methods are needed.

Significant versus important

With enough data, tiny effects become statistically significant: a picking method that is 0.3% faster may pass a test and still not matter. Report the size of effects with confidence intervals, and judge them against what they are worth in practice.

Interview kit

Practise it out loud

Answer each question yourself before opening the model answer.

Say it in 30 seconds

Before modelling I check the centre, using both mean and median because spikes distort the mean, the spread with standard deviation and coefficient of variation, outliers with box plots and the 1.5 × IQR rule or z-scores, and stationarity with rolling statistics and an ADF test. Outliers get investigated, not just deleted: a one-off bulk order should be removed from the baseline, a genuine shift shouldn’t.

Sales were 10, 11, 12, 13, 14, 14, 15, 16, 17, 18 and 45. Is 45 an outlier?

With Q1 ≈ 12 and Q3 ≈ 17, IQR ≈ 5, so the upper fence is about 17 + 7.5 = 24.5. 45 is well above it, so it’s flagged. Then I’d check why, for example a one-off bulk order, before deciding whether to exclude it from the baseline forecast.

How do you check whether a time series is stationary, and what do you do if it isn't?

Plot it with rolling mean and standard deviation to see whether level or variance drift, and run a test such as the augmented Dickey-Fuller test. If it isn’t stationary, difference it to remove trend, apply seasonal differencing, or take logs to stabilize variance, then model the transformed series.

Connected stops

Where this idea feeds in, or gets its inputs from.

Sources and further reading

  1. Tukey, J. W. (1977). Exploratory Data Analysis. Addison-Wesley.
  2. Hyndman, R. J. & Athanasopoulos, G. Forecasting: Principles and Practice (3rd ed.). OTexts. Sections on time series features and stationarity.
  3. Iglewicz, B. & Hoaglin, D. C. (1993). How to Detect and Handle Outliers. ASQC Quality Press.
  4. Granger, C. W. J., & Newbold, P. (1974). Spurious regressions in econometrics. Journal of Econometrics, 2(2), 111–120.
  5. Montgomery, D. C., & Runger, G. C. (2018). Applied Statistics and Probability for Engineers (7th ed.). Wiley.

Reading settings

Saved on this device. Changes apply as you choose them.

Theme
Text size
Typeface for reading
Line spacing
Line length
Start each topic at

Deeper levels stay one click away whichever you choose.

Preview

Safety stock covers the surprises while you wait for a delivery. It grows with the square root of lead time, not with lead time itself.

Lines

↑ ↓ move ↵ open Topics marked “Soon” open their line