Predictive, descriptive and prescriptive analytics
Clear, exam-focused notes on descriptive, predictive and prescriptive analytics: definitions, assumptions, OLS derivation, expected-utility decision rules, formulas, worked examples, common mistakes and quick checks.
Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
Predictive, descriptive and prescriptive analytics are the three main kinds of data analytics engineers use to turn data into decisions. An engineer uses descriptive analytics to summarise what happened, predictive analytics to forecast what will happen, and prescriptive analytics to choose actions that give the best expected outcome.
Key ideas
All terms are defined before use.
Data: observed values collected about phenomena (measurements, logs, transactions). Unit depends on the measurement (seconds, rupees, MB etc.).
Descriptive analytics: the branch of analytics focused on summarising past and current data without inference about causes. Exact definition: "Descriptive analytics produces compact representations (tables, aggregates, charts) of historical data to communicate what has occurred." Assumptions: data are recorded correctly; no causal claims are made.
What to draw in an exam: draw a timeline or bar chart sketch labelled "time" on x-axis and the chosen measure (e.g., "daily users") on y-axis, with a caption "Descriptive: trend and aggregates".
Predictive analytics: the branch that uses data and models to estimate future values or probabilities. Exact definition: "Predictive analytics builds a model f(·) that given input x estimates y^ = f(x) so that y^ approximates the unknown future y." Assumptions commonly used in university answers: observations are independent and identically distributed (i.i.d.), the training data are representative of future data, and model errors are random noise with zero mean. For time-series forecasting, the i.i.d. assumption is typically violated; respect time order in splits and use models that capture autocorrelation.
Important formal principle: Empirical risk minimisation (ERM). Definition: choose model parameters θ that minimise average loss on training data. For squared loss L(y, y^) = (y - y^)^2, ERM statement: θ^ = argmin_θ (1/n) Σ_{i=1..n} L(y_i, f_θ(x_i)).
Prescriptive analytics: the branch that recommends actions (decisions) using models, optimisation and utility/costs. Exact definition: "Prescriptive analytics selects an action a from action set A to maximise expected utility E[U(a,S)] where S denotes uncertain states of the world." Assumptions: utility values are known or can be estimated; probabilities over states are available or estimated by predictive models; decision-maker uses expected utility maximisation.
Model: any mapping f from inputs x to outputs y^. Definition: a parameterised function family f_θ(x). Examples: linear regression, decision tree, classifier. Assumptions: model family chosen should be able to represent the relationship (bias) and must be fitted using data.
Generalisation: ability of a fitted model to perform well on new (unseen) data. Measured by test set metrics. Overfitting and underfitting are common failure modes: overfitting occurs when a model matches training noise; underfitting when it cannot capture the underlying pattern.
Derivation universities commonly ask for (linear regression OLS normal equations). Start with the linear model (matrix form): y = Xβ + ε, where y is n×1 vector of outputs, X is n×p design matrix (first column ones if intercept), β is p×1 parameter vector, ε is noise vector.
Ordinary Least Squares (OLS) chooses β to minimise sum of squared residuals: S(β) = (y - Xβ)^T(y - Xβ).
Step 1: Expand S(β) = y^T y - 2 β^T X^T y + β^T X^T X β.
Step 2: Take derivative w.r.t β and set to zero: -2 X^T y + 2 X^T X β = 0.
Step 3: Rearranged normal equations: X^T X β = X^T y.
Step 4: Solve for β (assumption: X^T X invertible, i.e., columns of X are linearly independent): β^ = (X^T X)^{-1} X^T y.
State assumptions explicitly: observations i.i.d., linear relationship between features and expected response E[y|x] = x^T β, finite second moments, X^T X is full-rank. For Gauss–Markov optimality (OLS is BLUE), also assume E[ε|X] = 0 and Var(ε|X) = σ^2 I (no autocorrelation, homoscedasticity).
Prescriptive decision rule (derivation): Suppose a set of states S with probabilities p(s), and utilities u(a,s) for action a in state s. Expected utility of action a: EU(a) = Σ_s p(s) u(a,s). The prescriptive rule: choose a^ = argmax_{a ∈ A} EU(a). This follows directly from maximising expected value. In binary classification with misclassification costs C_FP (false positive) and C_FN (false negative) and predicted probability p = P(y=1|x), predict class 1 if p ≥ C_FP / (C_FP + C_FN); otherwise predict class 0.
Causation vs correlation: Prescriptive analytics should use causal information if interventions are required. Define causal inference: methods that attempt to estimate the effect of actions (interventions) on outcomes, not just association. If only correlations are used, actions may fail.
Where this fits with other topics: predictive models are trained using techniques from "Regression and decision trees", validated using "Model evaluation: ROC curves and tuning" and prepared using "Data wrangling" and "Data preprocessing in pandas".
Formulas
y = X β + ε — y: n×1 vector of observed outputs (unit of measurement of target), X: n×p design matrix (features; first column ones if intercept), β: p×1 parameter vector (units: target/unit(feature) for slope, target units for intercept), ε: residuals (same units as y). Applies to linear modelling.
S(β) = (y - X β)^T (y - X β) — sum of squared residuals; units: (target units)^2. Use when fitting by least squares.
X^T X β = X^T y — normal equations; applies when deriving OLS estimators.
β^ = (X^T X)^{-1} X^T y — OLS solution; requires X^T X invertible (full column rank). Units: same as β.
MSE = (1/n) Σ_{i=1..n} (y_i - y^_i)^2 — mean squared error (unit: (target units)^2). Use to measure regression error on sample.
EU(a) = Σ_s p(s) u(a,s) — expected utility of action a; p(s) dimensionless probability (unitless), u(a,s) utility (e.g., rupees, seconds saved). Use in prescriptive decisions.
EVPI = EU_perfect - EU_current — expected value of perfect information; units: same as utility. Applies when comparing value of extra information.
Worked examples
Example 1 — OLS linear regression (numerical, exam style) Problem: A processing job's size x (MB) and processing time y (s) were measured: (1,2), (2,3), (3,5), (4,4). Fit y = a + b x by OLS, compute predicted time for x = 5 MB and MSE on the given data. Steps:
- Compute means: x̄ = (1+2+3+4)/4 = 2.5 MB; ȳ = (2+3+5+4)/4 = 3.5 s.
- Compute sums S_xy = Σ(x_i - x̄)(y_i - ȳ) = 4.0 (MB·s) and S_xx = Σ(x_i - x̄)^2 = 5.0 (MB^2).
- Slope b = Cov/Var = 4.0 / 5.0 = 0.8 s/MB.
- Intercept a = ȳ - b x̄ = 3.5 - 0.8·2.5 = 1.5 s.
- Model: y^ = 1.5 + 0.8 x (units: seconds).
- Prediction for x = 5 MB: y^ = 1.5 + 0.8·5 = 5.5 s.
- Compute residuals and MSE: predictions: [2.3, 3.1, 3.9, 4.7] s. Squared errors: [0.09, 0.01, 1.21, 0.49]; sum = 1.80 s^2. MSE = 1.80 / 4 = 0.45 s^2. Answer: model parameters a = 1.5 s, b = 0.8 s/MB; predicted time at 5 MB = 5.5 s; MSE = 0.45 s^2.
Example 2 — Prescriptive decision using expected utility (numerical) Problem: A server admin decides to invest in a new server (action Invest) or do nothing (action NoInvest). If there is a high-traffic event (state High) with probability p = 0.3, then:
- Invest: cost ₹50,000, reduces outage loss by ₹100,000; net outcome in High = -50,000 + 100,000 = +50,000. We will express payoffs as net monetary outcome relative to current baseline. Assume: If Invest then in High state net = -50,000 (investment) + 100,000 benefit (reduced outage cost) = +50,000. If NoInvest then in High state net = -200,000. In Low state net outcome for Invest = -50,000 (wasted investment), for NoInvest = 0. Steps:
- Expected utility (money) for Invest: EU(Invest) = p·(+50,000) + (1-p)·(-50,000) = 0.3·50,000 + 0.7·(-50,000) = 15,000 - 35,000 = -20,000 ₹.
- EU(NoInvest) = p·(-200,000) + (1-p)·0 = 0.3·(-200,000) + 0 = -60,000 ₹.
- Compare: -20,000 ₹ > -60,000 ₹, so Invest is better.
- EV under perfect info: if we knew High occurs we would Invest (net +50,000), if Low occurs we would NoInvest (net 0). EU_perfect = p·50,000 + (1-p)·0 = 0.3·50,000 = 15,000 ₹.
- EVPI = 15,000 - (-20,000) = 35,000 ₹. Answer: choose Invest; expected loss -20,000 ₹ vs -60,000 ₹. Value of perfect information = 35,000 ₹. Note: examiner will check consistent sign convention; here positive means gain, negative loss.
Example 3 — Short model-selection note (theory) Model selection uses validation: split data into training and test, fit model on training, compute performance on test. A full-mark answer must state the reason (measure generalisation), list overfitting/underfitting, and name cross-validation as a solution.
Common mistakes
- Mixing units: not carrying units in regression slope/intercept answers.
- Wrong sign convention in expected utility (treating costs as positive instead of negative) — always state whether utility is payoff or cost.
- Using correlation from descriptive analytics to make causal prescriptive decisions without noting the need for causal inference.
- Reporting test-set performance computed on training data (reporting optimistic error).
For your exam
Types of questions you will see: definitions (short), short notes (differences between descriptive/predictive/prescriptive), derivations (OLS normal equations), numericals (fit a simple regression, compute MSE), decision problems (compute expected utility and EVPI), and diagram questions (draw analytics pipeline or decision tree with probabilities).
What full-marks answers include:
- For definitions: concise definition, assumptions, a brief example.
- For derivations: all algebraic steps, clearly stated assumptions (e.g., X^T X invertible), and final boxed result.
- For numericals: list given data, show each computational step, include units, and give final answer clearly labelled and in bold.
- For prescriptive problems: state utilities/payoffs, compute EU for each action, show which action maximises EU, and compute EVPI if asked.
Quick check
- Define predictive analytics in one sentence.
- Write the normal equations for OLS regression (matrix form).
- If action A has EU = -10,000 and action B has EU = -30,000 (both in ₹), which should you choose and why? Answers: 1) Predictive analytics builds models f(x) to estimate future y^ from inputs x using past data (with assumption training data represent future). 2) X^T X β = X^T y. 3) Choose A because -10,000 ₹ > -30,000 ₹ (maximise expected utility / minimise expected loss).
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?