Tutorials › Multi-Omics Data Integration › Scoring Predictive Performance In Simulations

Simulation Studies for Method Comparison · Tutorial 558 of 597

Scoring Predictive Performance In Simulations

Choose predictive performance metrics that match the outcome, prediction target, and population represented by the simulation.

Advanced 13 min read

What You'll Learn

  • Define the target-population prediction risk that a simulation score is intended to estimate.
  • Select error metrics for continuous outcomes and interpret their units.
  • Distinguish binary discrimination, calibration, and probability error.
  • Score survival predictions while accounting for censoring and the assumptions of weighting methods.
  • Compare observation-weighted and subject-weighted longitudinal scores.
  • Diagnose misleading scores caused by thresholds, imbalance, or a mismatched target population.

What Does a Predictive Score Measure?

A predictive score is useful only when it answers a defined question. In a simulation, the outcome-generating mechanism is specified, so the benchmark can ask how well a method predicts outcomes for new individuals drawn from a particular target population. A score calculated on the training data instead describes performance on data used to fit the method; it can be optimistic and need not estimate performance on new individuals.

Let \(Y\) denote an outcome, \(X\) the information available at prediction time, and \(f(X)\) a method's prediction. A target-population loss is the expected penalty for predicting with \(f\), averaging over the target distribution of \((X,Y)\). In practice, a simulation approximates this expectation using held-out test observations in each replicate. The choice of test population and its weighting are part of the estimand: a score for an equally weighted mixture of cohorts is not automatically a score for a population in which one cohort is more common.

Definition: Predictive performance is the performance of a specified prediction rule for a specified target population, outcome, and loss or metric. Error measures discrepancy between predictions and outcomes; discrimination measures how well predictions rank individuals with different outcomes; and calibration measures agreement between predicted and observed outcome levels or probabilities.

These properties are distinct. A model can rank individuals correctly while systematically predicting probabilities that are too high. It can also be well calibrated on average while making large individual prediction errors. No single metric summarizes all three properties. Before scoring, specify which variables the method may use, the prediction time, the outcome horizon, and whether the target is a new individual, a new site, or another defined population. Test data must represent that target and must not have contributed to model fitting or tuning.

Continuous Outcomes: Error and Scale

For continuous outcomes, common metrics compare observed values \(Y_i\) with predictions \(\hat{Y}_i\). The mean squared error (MSE) averages squared discrepancies, the root mean squared error (RMSE) returns the result to the outcome's units, and the mean absolute error (MAE) averages absolute discrepancies. The mean prediction error, with sign defined here as prediction minus outcome, describes average over- or underprediction.

$$ \operatorname{MSE}=\frac{1}{n}\sum_{i=1}^{n}(\hat{Y}_i-Y_i)^2,\qquad \operatorname{RMSE}=\sqrt{\operatorname{MSE}},\qquad \operatorname{MAE}=\frac{1}{n}\sum_{i=1}^{n}|\hat{Y}_i-Y_i| $$

MSE and RMSE penalize large errors more heavily than MAE. MSE has squared outcome units; RMSE and MAE have the original outcome units. These scores depend on the scale and spread of the outcome, so comparing raw RMSE values across outcomes measured on different scales can be misleading. A normalized metric can help with scale comparisons, but its denominator must be specified and may be unstable when the target outcome has little variation.

Worked Example: Continuous Prediction Error

In a hypothetical test set, three simulated expression values (in standardized expression units) are \(2,4,6\), and predictions are \(3,3,5\). The prediction-minus-outcome errors are \(1,-1,-1\).

The MSE is \((1^2+(-1)^2+(-1)^2)/3=1\) standardized expression unit squared. Therefore, the RMSE is \(\sqrt{1}=1\) standardized expression unit, and the MAE is \((1+1+1)/3=1\) standardized expression unit. The mean prediction error is \((1-1-1)/3=-0.333\) standardized expression units, indicating slight average underprediction in this test set. The error magnitudes are all equal here; the signed mean is not a measure of their overall size.

A useful justification explains why squared error reflects both irreducible outcome variability and prediction quality. Suppose \(m(X)=E(Y\mid X)\), and all expectations below are finite. Write \(Y-f(X)=[Y-m(X)]+[m(X)-f(X)]\), square, and take expectations. The cross-product has expectation zero because \(E[Y-m(X)\mid X]=0\). Thus:

$$ E[(Y-f(X))^2] = E[\operatorname{Var}(Y\mid X)] + E[(m(X)-f(X))^2]. $$

The first term is outcome variation that remains even with the conditional mean prediction; the second is the squared discrepancy between the fitted prediction rule and that conditional mean, averaged over the target distribution of \(X\). This identity is about squared-error risk, not a claim that observed test-set MSE separates those components exactly.

Binary Outcomes: Probabilities, Ranking, and Calibration

For a binary outcome \(Y_i\in\{0,1\}\), a method that predicts risk should generally be scored using predicted probabilities \(\hat{p}_i\), not only hard classifications. The Brier score is the mean squared error of those probabilities. Log loss penalizes assigning very small probability to an event that occurs, or to a non-event that occurs. Both are proper scoring rules: at the population level, expected score is minimized by reporting the true conditional event probability, under their usual definitions.

$$ \operatorname{Brier}=\frac{1}{n}\sum_{i=1}^{n}(\hat{p}_i-Y_i)^2,\qquad \operatorname{LogLoss}=-\frac{1}{n}\sum_{i=1}^{n} \left[Y_i\log(\hat{p}_i)+(1-Y_i)\log(1-\hat{p}_i)\right] $$

AUC (area under the receiver operating characteristic curve) measures discrimination: it is the probability that a randomly selected case receives a higher predicted risk than a randomly selected non-case, with half credit for a tie. It does not assess whether predicted risks are numerically accurate. Calibration asks whether predictions agree with observed frequencies, for example whether individuals assigned risks near 0.2 experience the event at about 20% frequency over a sufficiently large, relevant group. Calibration plots and calibration-in-the-large or calibration slope summaries can be informative, but estimates from small test sets are imprecise.

Worked Example: Binary Error Versus Discrimination

Consider four hypothetical test observations with outcomes \(1,0,1,0\) and event probabilities \(0.8,0.7,0.6,0.2\), respectively. The Brier score is \((0.8-1)^2+(0.7-0)^2+(0.6-1)^2+(0.2-0)^2\), divided by 4: \((0.04+0.49+0.16+0.04)/4=0.1825\).

The log loss is \([-\log(0.8)-\log(0.3)-\log(0.6)-\log(0.8)]/4\). Using natural logarithms, this is approximately \((0.2231+1.2040+0.5108+0.2231)/4=0.5403\). There are two cases, with scores 0.8 and 0.6, and two non-cases, with scores 0.7 and 0.2. Of the four case–non-case pairs, the case has higher risk in three, so AUC is \(3/4=0.75\). The AUC indicates some ability to rank cases above non-cases; it does not establish that the probabilities are calibrated. The mean predicted risk is \(0.575\), compared with the observed event fraction \(2/4=0.5\), a descriptive difference of 0.075 in this tiny test set, not a reliable calibration assessment by itself.

Accuracy and sensitivity require a probability threshold, such as classifying an observation as positive when \(\hat{p}_i\geq 0.5\). They can be useful when the decision threshold and costs of errors are specified in advance, but they discard probability information and depend on event prevalence. In simulations with rare outcomes, accuracy can be high for a method that predicts no events. Report threshold-based measures only with the threshold and relevant class-specific results; do not treat them as substitutes for probability error or calibration.

Survival Outcomes: Time, Risk, and Censoring

A survival prediction may be a risk score, a predicted survival curve \(S_i(t)=P(T_i>t\mid X_i)\), or a prediction for a prespecified time horizon. These are different prediction targets and require metrics that match them. Concordance measures ranking: among comparable pairs, it assesses how often the individual with the shorter event time receives the higher predicted risk. It does not measure the accuracy of predicted survival probabilities.

At a fixed horizon \(\tau\), a Brier score compares predicted survival probability with the indicator of surviving past \(\tau\). With complete event-time observation, this is simply a mean squared probability error. In real or simulated data with right censoring, the horizon-specific event status may be unknown for individuals censored before \(\tau\). A censoring-adjusted score, such as an inverse-probability-of-censoring-weighted (IPCW) Brier score, weights contributions by the estimated probability of remaining uncensored long enough for the relevant status to be observed. Its validity depends on an appropriate censoring model, conditional independent censoring given the variables used in that model, and positive probability of being observed over the required time range. If those conditions fail, the adjusted score can be biased or unstable.

Worked Example: Survival Ranking and Horizon Error

In a hypothetical test set, four individuals have fully observed event times \(2,4,5,7\) months and predicted risk scores \(0.9,0.7,0.4,0.2\). Every pair is correctly ordered: the earlier event has the higher risk score. There are \(4(3)/2=6\) pairs, so concordance is \(6/6=1\). This indicates perfect ranking in these six pairs, not perfect survival-time or probability prediction.

At \(\tau=4\) months, define the outcome as survival past month 4. The observed indicators are \(0,0,1,1\), and suppose the predicted probabilities of surviving past month 4 are \(0.1,0.2,0.7,0.8\). The horizon Brier score is \([(0.1-0)^2+(0.2-0)^2+(0.7-1)^2+(0.8-1)^2]/4 =(0.01+0.04+0.09+0.04)/4=0.045\). All event times are observed in this example, so no censoring adjustment is needed. If someone had been censored before month 4, their survival status at the horizon would be unknown and this unadjusted calculation would not be justified for that person.

Longitudinal Predictions and the Unit of Weighting

For repeated measurements, an observation-level score gives more weight to subjects with more observed visits. That may be appropriate when the target is a randomly selected visit from the target population. If the target is a randomly selected subject, first calculate each subject's average loss and then average those subject-level losses, giving each subject equal weight. These estimands differ when visit counts vary or errors vary within subjects. State whether the prediction concerns a new visit, a subject's trajectory, or a particular time point, and score only the time points and outcomes included in that target.

Worked Example: Observation-Weighted Versus Subject-Weighted Error

Suppose three hypothetical subjects have observed outcomes and predictions as follows, all in the same outcome units. Subject A has outcomes \(0,2\) and predictions \(0,2\); subject B has outcome \(5\) and prediction \(2\); subject C has outcomes \(1,2,3\) and predictions \(2,3,4\). Their squared errors are respectively \(0,0\); \(9\); and \(1,1,1\).

The observation-weighted MSE is \((0+0+9+1+1+1)/6=2\) outcome units squared, giving RMSE \(\sqrt{2}=1.414\) outcome units. For a subject-weighted score, the subject-specific MSEs are \(0\), \(9\), and \(1\), so the mean is \((0+9+1)/3=3.333\) outcome units squared and the corresponding root is \(\sqrt{3.333}=1.826\) outcome units. The larger subject-weighted score reflects equal weighting of subject B's large error despite that subject having only one visit. Neither score is universally preferable: each answers a different target-population question.

Diagnostics, Comparisons, and Limitations

A defensible scoring plan starts by matching the metric to the prediction target. For continuous outcomes, RMSE emphasizes large errors and MAE is less sensitive to them. For binary outcomes, Brier score and log loss assess probability predictions, AUC assesses ranking, and calibration summaries assess agreement between risk and frequency. For survival outcomes, concordance focuses on ranking while horizon-specific scores assess survival probabilities at stated times. For longitudinal outcomes, specify whether subjects or visits receive equal weight. None of these metrics alone proves that a method is useful for a clinical decision.

In each simulation replicate, score methods on the same independently generated test population when the comparison is intended to hold the test cases fixed. Aggregate scores only after preserving the replicate-level results and the intended target weighting. The average over test observations approximates a population score; a small test set can make that approximation noisy. The simulated outcome mechanism may also contain irreducible randomness, so even a correctly specified prediction rule will not generally predict every realized outcome exactly.

  • Check the target: verify that the test distribution, cohort mix, time horizon, and visit weighting match the intended population.
  • Check predictions: probabilities must lie in \([0,1]\); survival curves should be non-increasing in time and within \([0,1]\). Inspect extreme probabilities that can dominate log loss.
  • Check outcome prevalence and range: a high accuracy score can conceal poor detection of rare events, and raw continuous errors can be dominated by scale.
  • Check censoring and missing visits: identify who has unknown status at the evaluation horizon and whether the censoring or observation assumptions required by a weighted score are plausible.
  • Check aggregation: determine whether a subject with many visits is intended to contribute more, and avoid changing the target population accidentally through unequal replicate or cohort weighting.

A frequent mistake is to call AUC a measure of calibration because it is high, or to call a low RMSE proof that predictions are well calibrated in every subgroup. AUC depends on ordering, so any strictly increasing transformation of a risk score preserves its ranking while changing its probability meaning. RMSE averages squared errors and can hide systematic errors in particular groups or time periods. The correction is to report complementary metrics tied to the stated target, inspect relevant calibration and error patterns, and interpret each score only for what it measures.

Key takeaway: A simulation score is not an intrinsic property of a method. It estimates performance for a defined outcome, prediction target, metric, and target-population weighting. Report enough of those choices to make the score interpretable.

Check Your Understanding

Answer each question, then compare with the brief solutions below.

  1. For continuous outcomes, when might MAE be preferred to RMSE, and what are their units?
  2. A binary method has high AUC but consistently overpredicts risk. Which property is strong, and which needs assessment?
  3. At a survival horizon, a test subject is censored before that horizon. Why is their binary horizon outcome not directly known?
  4. In a longitudinal test set, some subjects have more visits. What distinction determines whether observation-weighted or subject-weighted error is appropriate?

Solutions. (1) MAE may be preferred when less emphasis on unusually large errors is desired; both MAE and RMSE have the outcome's original units. (2) Discrimination may be strong, but calibration and probability error need assessment; ranking does not establish accurate risk probabilities. (3) Censoring before the horizon leaves the event status at that horizon unobserved, so an unadjusted horizon score cannot treat that status as known. (4) The target determines the weighting: a randomly selected visit supports observation weighting, whereas a randomly selected subject supports equal subject weighting.

Clinical Biostats