Tutorials › Pattern-Mixture and Selection Models › Cross-Validation for MNAR Models and Its Limits

Comparing Alternative MNAR Models · Tutorial 186 of 499

Cross-Validation for MNAR Models and Its Limits

Use cross-validation to compare out-of-sample prediction for observed data, while keeping that evidence separate from claims about missing outcomes.

Advanced 12 min read

What You'll Learn

  • Define a cross-validation target that distinguishes observed outcomes from missing ones.
  • Calculate and interpret held-out log predictive scores.
  • Choose folds that respect the unit of independence in longitudinal or clustered data.
  • Diagnose leakage, selection, and instability in cross-validation comparisons.
  • Explain why observed-data prediction cannot verify MNAR extrapolations.

What Cross-Validation Can Compare

Cross-validation estimates how well a fitted model predicts data that were not used to fit it. For missing-not-at-random (MNAR) models, the phrase “predicts the data” needs care: the held-out outcomes that can be directly checked are the outcomes that were actually observed. A model can predict those well without correctly describing outcomes that were missing.

The comparison is meaningful only after the predictive target is specified. One target is the joint observed record, including the missingness pattern and all observed outcomes. Another is an outcome conditional on its having been observed, such as \(Y\mid R=1,X\), where \(R=1\) indicates observation and \(X\) denotes covariates. These targets answer different predictive questions. A joint score evaluates predictions of both the observation pattern and the observed values; a conditional outcome score evaluates observed values among records with the specified observation pattern.

Definition: In \(K\)-fold cross-validation, the independent observational units are divided into \(K\) groups, or folds. For each fold, a candidate model is fit using the other \(K-1\) folds and used to predict the held-out fold. A cross-validation score summarizes those held-out predictions. For an MNAR model, the target must be an observable quantity, such as an observed-data record or an outcome conditional on its observation pattern.

For example, let \(Y_i^{\mathrm{obs}}\) denote the observed components of subject \(i\)'s outcome vector, and let \(R_i\) encode which components are observed. With covariates \(X_i\) and training data \(D_{-k}\), a joint log predictive score for subject \(i\) in held-out fold \(k\) is

$$ \ell_{ik}=\log p_M(Y_i^{\mathrm{obs}},R_i\mid X_i,D_{-k}), \qquad \overline{\ell}_{\mathrm{CV}}=\frac{1}{n}\sum_{k=1}^{K}\sum_{i\in k}\ell_{ik}. $$

Here \(M\) labels the candidate model, and \(n\) is the number of held-out observational units. Larger average log scores are better: a model assigns greater predictive probability to the observed records. The probability in this expression is an observed-data predictive probability. In a likelihood-based MNAR model, it accounts for unobserved outcome components by integrating them out, rather than pretending that they were observed. If the goal is instead to score outcomes conditional on observation, use \(\log p_M(Y_i^{\mathrm{obs}}\mid R_i,X_i,D_{-k})\) and state that target explicitly.

Why the Log Score Is Useful

The log score rewards predictive distributions that put high probability on what happens and penalizes confident predictions that assign it very low probability. Its justification can be seen by considering a discrete observable record \(Z\), with true distribution \(q(z)\) and a candidate predictive distribution \(p(z)\). The expected log score under the true distribution is \(\sum_z q(z)\log p(z)\). Subtracting the score of the true distribution gives

$$ \sum_z q(z)\log p(z)-\sum_z q(z)\log q(z) =-\sum_z q(z)\log\left(\frac{q(z)}{p(z)}\right) =-D_{\mathrm{KL}}(q\Vert p)\leq 0. $$

The final inequality follows from nonnegativity of Kullback–Leibler divergence, with equality when \(p=q\) on the support of \(q\). Thus, in expectation, the log score favors the correct distribution for the target being scored. It does not say that a finite cross-validation sample will rank models correctly, nor that a model with the best score is true. Most importantly, the result concerns the distribution of the scored observable records, not an unobserved-outcome distribution that the score never tests.

For continuous outcomes, the analogous score uses a predictive density evaluated at the held-out value. Density scores depend on the measurement scale, so comparisons require a consistent outcome representation and density convention across candidates. Scores from different targets or incompatible scales should not be compared as if they measured the same prediction task.

Worked Example: Comparing Mean Held-Out Log Scores

Suppose two hypothetical MNAR candidates are fit on the same training data and then score the same five held-out observed records. For each record, the numbers below are the candidates’ predictive probabilities for the exact observable record that occurred. Candidate A assigns probabilities \(0.30, 0.30, 0.40, 0.30, 0.30\); Candidate B assigns \(0.35, 0.35, 0.30, 0.35, 0.35\). These are record-specific probabilities, not probabilities that must sum to one across the five different records.

The total joint log score for A is

$$ 3\log(0.30)+\log(0.40) =3(-1.2039728)+(-0.9162907) =-4.5282091. $$

Its mean score is \(-4.5282091/5=-0.9056418\), or \(-0.9056\) log-probability units per record. For B, the calculation is

$$ 4\log(0.35)+\log(0.30) =4(-1.0498221)+(-1.2039728) =-5.4032613. $$

B's mean score is \(-5.4032613/5=-1.0806523\), or \(-1.0807\) per record. Candidate A's mean-score advantage is \(-0.9056418-(-1.0806523)=0.1750105\), which rounds to \(0.1750\) log-probability units per record. A predicted these five held-out observable records better on average in this fold. Five records do not establish that it will predict better in a new sample, and the comparison says nothing by itself about which candidate better describes missing outcomes.

Designing Folds and Fitting Each Candidate

The split must match the unit to which predictions are intended to generalize. If each subject contributes repeated visits, randomly placing visits from one subject in both training and test sets can let information about that subject leak into the fit. For prediction to new subjects, put all visits from a subject in the same fold. Likewise, use site-level or cluster-level folds when the target is prediction at new sites or clusters. The split should reflect the scientific use of the prediction, not merely make the folds convenient.

Within each fold, fit the candidate using only the training data. Any data-dependent preprocessing, variable selection, tuning, or imputation used to construct predictions must also be learned from that training data alone. Otherwise, held-out information influences the prediction before it is scored. For a Bayesian candidate, the held-out predictive distribution averages over parameter uncertainty given the training data. For a frequentist candidate, the prediction may instead use fitted parameter estimates; whichever convention is used should be consistent across candidates.

An MNAR model generally specifies both an outcome distribution and a model for observation or dropout, with dependence between them. For a joint observed-record score, the held-out probability must be computed under the candidate’s observed-data distribution: latent missing components are integrated out, and the probability of the recorded observation pattern is included. A conditional outcome score has a different interpretation and may not assess whether the model predicts the observation pattern. Neither choice makes the missing outcomes in the held-out records observable.

Worked Example: Observational Equivalence and Unseen Outcomes

Consider a hypothetical binary outcome \(Y\) and observation indicator \(R\). Suppose both candidates assign \(P(R=1)=0.5\), and, among observed records, both assign \(P(Y=1\mid R=1)=0.20\). Candidate A sets \(P(Y=1\mid R=0)=0.30\); Candidate B sets \(P(Y=1\mid R=0)=0.80\). The observed-record probabilities are identical: \(P(R=1,Y=1)=0.5(0.20)=0.10\), \(P(R=1,Y=0)=0.5(0.80)=0.40\), and \(P(R=0)=0.50\). When \(R=0\), \(Y\) is not part of the observed record.

If the candidates give the same held-out predictive distribution for every observable record, conditional on the training data, their log scores for those records are identical. In this constructed example, the observed-record distributions coincide, while the assumptions about \(Y\) when \(R=0\) differ. The population outcome means implied by the two candidates are nevertheless different:

$$ E_A(Y)=0.5(0.20)+0.5(0.30)=0.25, \qquad E_B(Y)=0.5(0.20)+0.5(0.80)=0.50. $$

The \(0.25\) difference in implied means cannot be resolved by scoring these observed records: the score never sees \(Y\) when \(R=0\). More generally, equality of candidates’ observed-data distributions at a data-generating parameter value does not, on its own, guarantee that every fitting procedure returns identical held-out predictions. The precise score equality applies when the candidates’ held-out predictive distributions for the observable records, conditional on the training data, are the same.

Reading Score Differences and Diagnosing Failure

Cross-validation scores are estimates with sampling variability. Since candidates are evaluated on the same held-out units, retain paired score differences, rather than comparing unrelated averages. A few unusually influential records can dominate a log score, especially when one model assigns an observed record a very small probability. Inspect fold-specific and record-specific contributions, and check that all scored probabilities or densities are finite and computed for the same target.

Worked Example: A Small, Uncertain Paired Advantage

In a hypothetical four-fold comparison, suppose the subject-level differences in log score, defined as Candidate A minus Candidate B, are \(0.20, 0.10, -0.05,\) and \(0.15\). The average difference is

$$ \bar{x}_{\Delta}=\frac{0.20+0.10-0.05+0.15}{4}=0.100. $$

For these four differences, the sample standard deviation is

$$ s_{\Delta}=\sqrt{\frac{(0.20-0.10)^2+(0.10-0.10)^2+(-0.05-0.10)^2+(0.15-0.10)^2}{4-1}} =\sqrt{\frac{0.035}{3}}=0.1080. $$

The standard error of their mean, treating the four differences as the units for this simple illustration, is \(SE=s_{\Delta}/\sqrt{4}=0.0540\). The estimated advantage of A is \(0.100\) log-score units per unit, but the fold-level differences vary and include one favoring B. This small example is a warning against treating a positive average as a conclusive ranking; a formal uncertainty analysis must account for the actual sampling and fold design.

Other useful diagnostics include checking whether fold sizes and missingness patterns are reasonably represented, whether a candidate’s score depends heavily on one fold, and whether a model failed to fit in some training splits. A model that produces extreme predictions or numerical integration failures may have unstable predictive behavior even if its overall average looks favorable. Report the split unit, the scored target, the aggregation rule, and the variability of paired differences.

Cross-validation complements, rather than replaces, other checks. Artificial-masking calibration evaluates predictions for outcomes deliberately hidden from records where those outcomes were observed; it provides a different and limited check because the artificially hidden cases may not resemble genuinely missing cases. Residual and posterior predictive checks examine aspects of the observed data under the fitted model. Cross-validation evaluates held-out prediction for its chosen observable target. None of these procedures directly verifies an MNAR assumption about outcomes that are never observed.

Alternatives and Limits

A single held-out split is simple but can depend strongly on which records were selected for validation. Repeated or \(K\)-fold cross-validation uses the data more broadly, though overlapping training sets mean fold scores are not automatically independent replicates. Leave-one-out cross-validation reduces the size of each held-out set but can be computationally demanding and may estimate a target that differs from prediction using a substantially smaller training sample. The split design and target remain more important than the number of folds.

The earlier material on artificial-masking calibration addresses a useful prediction check for outcomes whose values are known before masking. Cross-validation generalizes held-out evaluation to observed records, including their observation patterns when that is the target. Information criteria and Bayesian model evidence are other model-comparison approaches, but they answer different questions and do not turn observed data into evidence about unidentified missing-outcome distributions.

The central limitation is identification. If alternative MNAR specifications fit the same observable distribution but imply different distributions for unobserved outcomes, a score based only on observable records cannot determine which unobserved distribution is correct. Cross-validation can still reveal poor predictive performance on observable data and can help compare candidates for that task. It is not a validation certificate for the extrapolation from observed to missing outcomes, and it does not establish that the highest-scoring candidate is the true mechanism.

Key takeaway: Cross-validation compares predictions for a declared held-out observable target. A better observed-data score is evidence about prediction of that target under the chosen split and fitting procedure; it is not, by itself, evidence that the model’s MNAR assumptions about unobserved outcomes are correct.

Check Your Understanding

Answer each question, then compare with the solutions.

  1. What must be specified before interpreting an MNAR cross-validation score?
  2. Why can randomly splitting repeated visits across training and test sets be misleading when the target is prediction for new subjects?
  3. Two candidates give identical held-out predictive probabilities for every observable record, conditional on the training data, but different distributions for missing outcomes. What can their observed-record log scores establish?
  4. For a joint observed-record score, what should a candidate’s predictive probability account for?

Solutions. (1) Specify the predictive target, such as the joint observation pattern and observed outcomes or the outcome conditional on its observation pattern, along with the scoring rule. (2) Training visits can reveal information about a subject whose other visits appear in the test set, so the test no longer represents prediction for a genuinely new subject. (3) Their scores for those observable records are identical, so this score cannot distinguish their different missing-outcome distributions. (4) It should account for the recorded observation pattern and observed outcome components under the candidate’s observed-data distribution, integrating over components that are missing.

Clinical Biostats