Statistical Foundations for PredictionIntroductionPredictive analytics converts historical observations into estimates about unknown or future outcomes. Although software can fit sophisticated models automatically, reliable prediction depends on statistical foundations: uncertainty must be represented, data must be sampled appropriately, variables must be measured consistently, and model performance must be interpreted rather than merely reported. This chapter develops the statistical concepts required before applying regression, classification, and time-series forecasting. It explains probability, sampling, distributions, covariance and correlation, hypothesis testing, confidence intervals, and the bias–variance trade-off. The emphasis is practical: a business analyst should be able to calculate essential quantities, identify assumptions, recognise misleading results, and communicate uncertainty to decision-makers. Learning ObjectivesBy the end of this chapter, you should be able to: - Explain probability as a measure of uncertainty and use conditional probability and Bayes’ theorem.
- Distinguish populations, samples, parameters, statistics, sampling error, and bias.
- Interpret common probability distributions used in predictive modelling.
- Calculate and interpret covariance, correlation, and standardised relationships.
- Formulate hypotheses and use p-values, confidence intervals, and significance levels appropriately.
- Explain bias, variance, underfitting, overfitting, and their implications for prediction.
- Apply these concepts to a practical business analytics problem.
1. Probability and UncertaintyProbability assigns a number between 0 and 1 to an event. A probability of 0 indicates impossibility, while 1 indicates certainty. If A and B are events, the complement of A is written Aᶜ and represents “A does not occur.” The basic rules are: P(Aᶜ) = 1 − P(A) P(A ∪ B) = P(A) + P(B) − P(A ∩ B) Here, ∪ means “A or B,” and ∩ means “A and B.” The subtraction prevents the overlap from being counted twice. If A and B are mutually exclusive, they cannot occur together, so P(A ∩ B) = 0. Conditional probability and independenceConditional probability measures the likelihood of A when B is known to have occurred: P(A | B) = P(A ∩ B) ÷ P(B), P(B) > 0 Events A and B are independent when knowledge of one does not change the probability of the other: P(A ∩ B) = P(A)P(B) Independence is a strong assumption. For example, two randomly selected customer transactions may be approximately independent, but successive daily sales may not be independent because of seasonality, promotions, and trends. Bayes’ theoremBayes’ theorem reverses conditional probabilities: P(A | B) = [P(B | A)P(A)] ÷ P(B) P(A) is the prior probability, P(B | A) is the likelihood, P(B) is the marginal probability of the evidence, and P(A | B) is the posterior probability. In classification, A may represent a class such as “customer will churn,” while B may represent observed behaviour. For mutually exclusive and exhaustive hypotheses A₁, …, Aₖ: P(Aᵢ | B) = [P(B | Aᵢ)P(Aᵢ)] ÷ ∑ⱼ P(B | Aⱼ)P(Aⱼ) A common managerial error is to confuse P(B | A) with P(A | B). If a fraud detection system is highly accurate for fraudulent transactions, that does not automatically mean that every flagged transaction is fraudulent. The base rate of fraud must also be considered. Expected value and varianceFor a discrete random variable X with possible values xᵢ and probabilities pᵢ: E(X) = μ = ∑ᵢ xᵢpᵢ The expected value is a probability-weighted average, not necessarily an outcome that will actually occur. Variance measures dispersion around the mean: Var(X) = σ² = E[(X − μ)²] = ∑ᵢ (xᵢ − μ)²pᵢ The standard deviation is the square root of variance: σ = √Var(X) Variance is expressed in squared units; standard deviation has the same units as X and is therefore easier to interpret. 2. Populations, Samples, and SamplingA population is the complete set of units relevant to a question, such as all customers who made a purchase during a year. A sample is a subset used to learn about that population. A population parameter, such as μ, describes the population; a sample statistic, such as x̄, describes the sample. The sample mean is: x̄ = (1 ÷ n)∑ᵢ₌₁ⁿ xᵢ where n is the sample size. The usual sample variance is: s² = [1 ÷ (n − 1)]∑ᵢ₌₁ⁿ (xᵢ − x̄)² The n − 1 denominator, called Bessel’s correction, makes s² an unbiased estimator of the population variance under random sampling. It is not appropriate to use this correction mechanically when the dataset is the entire population of interest. Sampling error and sampling biasSampling error is random variation arising because a sample rather than the full population is observed. It generally decreases as sample size increases. Sampling bias is systematic distortion caused by the way observations are selected or measured; increasing the sample size does not necessarily remove it. Important sampling problems include: - Coverage bias: some population members cannot be selected.
- Non-response bias: selected units do not provide data, and responders differ from non-responders.
- Convenience sampling: observations are selected because they are easy to obtain.
- Survivorship bias: analysis includes only units that remain observable.
- Data leakage: information unavailable at prediction time enters the training data.
Random sampling gives each population unit a known selection mechanism. Stratified sampling divides the population into relevant groups and samples within each group. Cluster sampling selects groups rather than individual units. In business data, analysts often work with convenience or transaction data, so the intended population and limitations of generalisation must be stated explicitly. Sampling distributions and the standard errorA sampling distribution is the distribution of a statistic across repeated samples. Under independent observations with finite variance, the standard error of the sample mean is: SE(x̄) = σ ÷ √n When σ is unknown, it is estimated by s: SE(x̄) ≈ s ÷ √n The central limit theorem states, broadly, that the sampling distribution of the mean tends toward a normal distribution as n increases, even when individual observations are not normal, provided observations are sufficiently independent and the variance is finite. It does not say that the raw data become normal, nor does it guarantee good results for highly dependent, extremely skewed, or very small samples. 3. Probability Distributions Used in PredictionA probability distribution describes how probability is allocated across possible values of a random variable. Discrete distributionsA Bernoulli random variable represents one trial with success probability p and failure probability 1 − p. If X is coded 1 for success and 0 for failure: E(X) = p, Var(X) = p(1 − p) A binomial variable counts successes in n independent Bernoulli trials with a common success probability p: P(X = k) = C(n,k)pᵏ(1 − p)ⁿ⁻ᵏ where k is the number of successes and C(n,k) is the number of ways to choose k successes from n trials. The binomial model is unsuitable when trials are dependent or probabilities vary substantially between trials. Continuous distributionsA normal distribution is described by mean μ and standard deviation σ. Its density is: f(x) = [1 ÷ (σ√(2π))] exp[−(x − μ)² ÷ (2σ²)] The normal model is symmetric and continuous. Its standardised value, or z-score, is: z = (x − μ) ÷ σ A z-score indicates how many standard deviations an observation lies from the mean. The empirical rule approximately associates 68%, 95%, and 99.7% of observations with intervals of one, two, and three standard deviations respectively, but this rule applies only to distributions that are approximately normal. The t distribution has heavier tails than the normal distribution and is commonly used for inference about a mean when the population standard deviation is unknown, especially with smaller samples. The degrees of freedom affect its shape. The chi-square distribution is used in variance-related procedures and tests of categorical association; the F distribution is used in variance ratios and analysis of variance. Distributional assumptions concern the data or model errors, not necessarily every predictor. Transformations, robust methods, resampling, or appropriate non-normal models may be preferable to forcing business data into a normal distribution. 4. Covariance, Correlation, and AssociationCovariance measures whether two variables tend to move together: sₓᵧ = [1 ÷ (n − 1)]∑ᵢ₌₁ⁿ (xᵢ − x̄)(yᵢ − ȳ) A positive covariance indicates that above-average values of X tend to occur with above-average values of Y. Its magnitude depends on the units of both variables, so it is difficult to compare across datasets. Pearson’s sample correlation standardises covariance: r = sₓᵧ ÷ (sₓsᵧ) where sₓ and sᵧ are sample standard deviations. The value of r lies between −1 and +1. Values near +1 indicate strong positive linear association, values near −1 indicate strong negative linear association, and values near 0 indicate little linear association. Correlation does not establish causation. A strong correlation may result from a common time trend, reverse causality, confounding, or coincidence. Correlation also measures linear association: a strong curved relationship can have a correlation near zero. Outliers can substantially change r. Analysts should inspect scatterplots, consider time ordering, and examine domain explanations. For a simple linear regression with an intercept, the coefficient of determination is: R² = 1 − [∑ᵢ(yᵢ − ŷᵢ)² ÷ ∑ᵢ(yᵢ − ȳ)²] R² is the proportion of sample variation in the outcome explained by fitted values relative to a mean-only benchmark. It is not a percentage probability that the model is correct, and a high R² does not prove causality or guarantee accurate future forecasts. 5. Hypothesis TestingHypothesis testing provides a structured way to assess whether sample evidence is inconsistent with a specified null model. The null hypothesis H₀ usually represents no difference, no association, or a specified parameter value. The alternative hypothesis H₁ represents the claim being investigated. A test requires: - A clearly defined parameter and population.
- Null and alternative hypotheses established before examining results.
- A test statistic and reference distribution.
- A significance level α, often 0.05.
- A decision rule and substantive interpretation.
For a one-sample mean with known population standard deviation σ: z = (x̄ − μ₀) ÷ (σ ÷ √n) where μ₀ is the null-hypothesised mean. If σ is unknown and the assumptions are appropriate, the one-sample t statistic is: t = (x̄ − μ₀) ÷ (s ÷ √n) with n − 1 degrees of freedom. A p-value is the probability, assuming H₀ is true, of obtaining a result at least as extreme as the observed result according to the specified alternative. A small p-value indicates incompatibility with H₀; it does not measure the probability that H₀ is true, the size of an effect, or its business importance. A Type I error rejects a true H₀, with long-run probability controlled by α under the test assumptions. A Type II error fails to reject a false H₀. Statistical power is the probability of detecting a specified effect under a specified alternative. Power depends on effect size, sample size, variability, and α. “Fail to reject” is preferable to “accept” the null hypothesis because a non-significant result may reflect insufficient information. Multiple testing increases the chance of false positives. When many hypotheses are tested, analysts should pre-specify primary outcomes or control the family-wise error rate or false discovery rate. 6. Confidence Intervals and Practical UncertaintyA confidence interval gives a range produced by a procedure that, over repeated samples, captures the fixed population parameter at a stated rate. A commonly used interval for a mean when σ is unknown is: x̄ ± t* (s ÷ √n) Here t* is the appropriate critical value from the t distribution, based on the confidence level and n − 1 degrees of freedom. For a 95% interval, the procedure has 95% long-run coverage under its assumptions. It is not technically correct to say that there is a 95% probability that the already-fixed parameter lies in this particular interval, although that wording is often used informally. A 95% confidence interval that excludes zero is equivalent to rejecting a two-sided null hypothesis of zero at α = 0.05, when the same model and assumptions are used. The interval also communicates effect size and precision, often more usefully than a p-value alone. Worked example: average delivery timeAn operations team samples n = 25 deliveries. The sample mean is x̄ = 42 minutes and the sample standard deviation is s = 10 minutes. A 95% interval uses t* ≈ 2.064 with 24 degrees of freedom: SE = 10 ÷ √25 = 2 minutes CI = 42 ± 2.064(2) = 42 ± 4.128 Thus the interval is approximately 37.9 to 46.1 minutes. This describes uncertainty about the population mean under random-sampling and independence assumptions. It does not imply that 95% of individual deliveries fall in this interval; individual delivery times are generally more variable than the estimated mean. 7. Bias–Variance Trade-off in PredictionPrediction error arises from several sources. For a target value Y and a model trained on dataset D, the expected squared prediction error at input x can be decomposed conceptually as: E[(Y − f̂D(x))²] = Bias²[f̂D(x)] + Var[f̂D(x)] + σ² The left side is expected prediction error over new outcomes and possible training datasets. Bias² measures systematic error from an overly restrictive model. Variance measures sensitivity to the particular training sample. σ² represents irreducible noise when the data-generating process contains randomness not captured by available predictors. A simple model may have high bias and low variance: it is stable but unable to capture meaningful structure. A highly flexible model may have low training error but high variance: it adapts to noise and performs poorly on new data. This is underfitting versus overfitting. The trade-off is managed through: - separating training, validation, and test data;
- cross-validation for model and hyperparameter selection;
- regularisation, such as penalising large coefficients;
- feature selection and sensible feature engineering;
- early stopping, pruning, or limiting model complexity;
- collecting more representative data;
- evaluating on a time-appropriate holdout for forecasting.
For time series, random cross-validation can leak future information into the past. A rolling-origin or expanding-window evaluation preserves temporal order. The test set should be used sparingly for final performance assessment, not repeated tuning. 8. An Illustrative Business Case: Subscription ChurnThis is a fictional illustrative case. Background and problemA subscription company wants to identify customers likely to cancel within the next 30 days. It has transaction records, service usage, customer tenure, support contacts, and a cancellation indicator. Management wants a targeted retention programme, but it must avoid wasting incentives and must not treat a risk score as proof that an individual will cancel. AnalysisThe analytics team defines the prediction time clearly: only information available at the end of each month may be used. The outcome is cancellation during the following 30 days. This prevents leakage from using post-cancellation events. The team creates a temporally ordered training period, validation period, and later test period. The base cancellation rate is 8%. A model that flags 20% of customers is evaluated using a confusion matrix and business costs, not accuracy alone. If the model identifies 60% of cancellations, its recall is: Recall = True Positives ÷ (True Positives + False Negatives) Precision is: Precision = True Positives ÷ (True Positives + False Positives) Because only 8% cancel, a model can have apparently high accuracy while missing most cancellations. The team examines calibration: among customers assigned a 0.20 risk, approximately 20% should cancel over comparable groups if the model is calibrated. The team also studies correlations among usage variables. A strong association between support contacts and churn may be predictive without being causal. Contact frequency could reflect an unresolved service problem, but sending more support messages alone may not reduce churn. A controlled experiment is needed to estimate the effect of an intervention. Approach and outcomeA regularised logistic model is compared with a tree-based model using the same temporal validation design. Confidence intervals or bootstrap intervals are reported for key performance measures. The final decision threshold is selected using the expected cost of incentives, staff time, missed cancellations, and customer experience. Before deployment, the company checks performance across customer segments. If a proxy variable produces systematically worse treatment for a protected group, the variable and decision process require review. Scores are monitored because customer behaviour, pricing, and product design change over time. Learning pointsThe case demonstrates that statistical foundations influence the whole workflow: base rates affect interpretation, sampling and time order affect validity, correlation is not causation, uncertainty should accompany performance estimates, and bias–variance control must be evaluated on genuinely unseen data. 9. Limitations, Ethics, and Best PracticeStatistical conclusions are conditional on data quality, design, and assumptions. Missing data may be informative rather than random. Measurement definitions may change over time. Aggregation can hide subgroup differences, while small subgroups can produce unstable estimates. Analysts should document data provenance, inclusion criteria, transformations, missing-value treatment, and modelling assumptions. Prediction systems can reproduce historical discrimination if past decisions or data collection were biased. Fairness cannot be established by a single metric because definitions such as demographic parity, equalised error rates, and calibration may conflict. Organisations should assess necessity, proportionality, transparency, access control, retention, and human oversight. Personal data should be processed lawfully and securely, with appropriate governance under applicable privacy and sector regulations. Best practice includes: - define the decision and prediction horizon before modelling;
- distinguish prediction from causal explanation;
- inspect distributions, missingness, outliers, and sampling mechanisms;
- report effect sizes and intervals, not p-values alone;
- test assumptions and use robust alternatives where necessary;
- prevent leakage and preserve time order in forecasting;
- compare against simple baselines;
- monitor drift, calibration, subgroup performance, and real-world outcomes;
- communicate uncertainty and limitations to decision-makers.
Chapter SummaryProbability provides the language for uncertain outcomes, while conditional probability and Bayes’ theorem support classification and diagnosis. Sampling determines whether conclusions can generalise, and sampling error must be distinguished from systematic bias. Probability distributions describe random behaviour and provide reference models for inference. Covariance and correlation quantify association but do not establish causation. Hypothesis tests evaluate evidence against a null model; p-values require careful interpretation and should be accompanied by effect sizes and confidence intervals. Confidence intervals communicate precision under stated assumptions. Finally, the bias–variance framework explains why models that fit training data well may fail on new observations. Ethical prediction requires attention to leakage, fairness, privacy, transparency, and ongoing monitoring. Key TermsProbability: A numerical measure of uncertainty about an event. Conditional probability: The probability of one event given that another event has occurred. Independence: A condition in which knowledge of one event does not change the probability of another. Bayes’ theorem: A rule for updating a prior probability using observed evidence. Random variable: A variable whose value is determined by a random process. Expected value: The probability-weighted average outcome of a random variable. Variance: The expected squared deviation from the mean. Population: The complete set of units relevant to an analysis. Sample: A subset of a population used for analysis. Parameter: A numerical characteristic of a population. Statistic: A numerical characteristic calculated from a sample. Sampling error: Random difference between a sample result and the population value. Sampling bias: Systematic distortion caused by selection or measurement processes. Standard error: The standard deviation of a statistic’s sampling distribution. Covariance: A measure of the joint directional variation of two variables. Correlation: A standardised measure of linear association. Null hypothesis: A specified benchmark claim tested against sample evidence. p-value: The probability, under the null model, of a result at least as extreme as observed. Confidence interval: An interval generated by a procedure with stated long-run coverage. Bias–variance trade-off: The balance between systematic error and sensitivity to training data. Review QuestionsShort Answer Questions- Distinguish a population parameter from a sample statistic.
- What is the difference between sampling error and sampling bias?
- Why does correlation not establish causation?
- Define a p-value in the context of hypothesis testing.
- What is meant by model variance?
Long Answer Questions- Explain conditional probability and Bayes’ theorem, including a business example.
- Compare the normal, binomial, and Bernoulli distributions and identify an appropriate application for each.
- Explain how a confidence interval differs from a point estimate and a prediction interval.
- Discuss Type I error, Type II error, statistical power, and practical significance.
- Explain how training, validation, and test data help control overfitting.
Analytical / Application Questions- A fraud system flags 5% of transactions, while the underlying fraud rate is 1%. Explain why the proportion of flagged transactions that are actually fraudulent cannot be inferred from detection accuracy alone. Identify the additional probabilities required.
- A sample of 36 delivery times has mean 50 minutes and standard deviation 12 minutes. Calculate the estimated standard error of the mean and explain what it represents.
- A churn model has high accuracy but low recall. Using base rates, precision, recall, and business costs, recommend how the organisation should evaluate and deploy the model.
Multiple Choice Questions with AnswersQuestion 1Which expression correctly defines conditional probability when P(B) > 0? A. P(A | B) = P(A) + P(B) B. P(A | B) = P(A ∩ B) ÷ P(B) C. P(A | B) = P(A) ÷ P(Bᶜ) D. P(A | B) = P(A ∪ B) ÷ P(A) Correct Answer: B. P(A | B) = P(A ∩ B) ÷ P(B) Question 2A population has mean μ = 80 and standard deviation σ = 12. For a random sample of n = 36 independent observations, what is the standard error of the sample mean? A. 0.33 B. 2 C. 12 D. 72 Correct Answer: B. 2 Question 3Which statement about a p-value is correct? A. It is the probability that the null hypothesis is true. B. It is the probability that the alternative hypothesis is true. C. It is the probability, assuming the null model, of a result at least as extreme as observed. D. It is the probability that the sample was collected without bias. Correct Answer: C. It is the probability, assuming the null model, of a result at least as extreme as observed. Question 4Which measure is standardised and constrained between −1 and +1? A. Covariance B. Variance C. Correlation D. Standard error Correct Answer: C. Correlation Question 5If a model is too simple to capture important patterns in the data, it is most likely experiencing: A. High bias and underfitting B. High variance and overfitting C. Zero irreducible error D. Sampling independence Correct Answer: A. High bias and underfitting Question 6A 95% confidence interval for a mean is best interpreted as: A. 95% of individual observations lie inside the interval. B. There is a 95% probability that the fixed parameter moves into the interval. C. A procedure producing intervals that capture the parameter in approximately 95% of repeated samples, under its assumptions. D. The model has 95% predictive accuracy. Correct Answer: C. A procedure producing intervals that capture the parameter in approximately 95% of repeated samples, under its assumptions. Question 7Which situation is an example of data leakage in churn prediction? A. Using customer tenure measured at the prediction date B. Using only training-period observations C. Using a cancellation reason recorded after the prediction date D. Evaluating on a later time period Correct Answer: C. Using a cancellation reason recorded after the prediction date Question 8If two events are independent, which relationship holds? A. P(A ∩ B) = P(A) + P(B) B. P(A ∩ B) = P(A)P(B) C. P(A | B) = 0 D. P(A ∪ B) = 1 Correct Answer: B. P(A ∩ B) = P(A)P(B) Question 9For a sample of n = 25, x̄ = 42, and s = 10, what is the estimated standard error of the mean? A. 0.4 minutes B. 2 minutes C. 10 minutes D. 50 minutes Correct Answer: B. 2 minutes Question 10Why can a model with high accuracy still be unsuitable for detecting rare churn events? A. Accuracy always measures causal impact. B. A majority-class prediction can be accurate while missing most positive cases. C. Recall is unrelated to classification. D. Rare events eliminate sampling bias. Correct Answer: B. A majority-class prediction can be accurate while missing most positive cases.
|