Manuscript Offprint
arXiv:2610.08689Probabilistic Counterfactual Inference for Discrete Outcomes in Gaussian-Process Causal Models
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Counterfactual inference in Gaussian-process structural causal models (GP-SCMs) has been developed primarily for continuous endogenous variables, limiting applicability to causal graphs that contain discrete child nodes with continuous parents. We introduce a unified probabilistic framework for counterfactual inference with heterogeneous variable types by pairing GP predictors with explicit exogenous noise mechanisms. For discrete outcomes, we derive exact conditional noise-abduction procedures using a uniform threshold for binary variables, a Gumbel-max race for nominal categories, and a latent Gaussian cut-point model for ordinal ones. In each case, we propagate abducted noise through interventions while accounting for posterior uncertainty in the GP latent functions, and prove that the resulting mechanisms reproduce the fitted model's observational and interventional distributions. On synthetic SCMs with known ground-truth counterfactuals, we evaluate estimation accuracy, consistency, and robustness to coupling misspecification. A key finding is that applying a categorical coupling to ordinal data inflates counterfactual error roughly threefold even when observational fit remains comparable, and that this error does not diminish with more data. As the training set grows, the fitted structural equation converges to the truth while the counterfactual error flattens onto a floor. In the reverse direction, forcing a false order onto nominal data instead degrades the fitted equation itself. The choice of coupling must therefore be justified on structural grounds rather than read off the fit.
1 Introduction
Incorporating causality into Machine Learning can be a crucial step towards developing realistic and explainable models. Pearl et al. [2016] has shown that structural causal models (SCMs) can be used to determine the effects of interventions and estimate counterfactual queries. Interventions compute the downstream effects of changing one or more variables in a system. Counterfactuals extend upon this by using knowledge of a factual instance to compute how the variables would have changed had an intervention been performed.
To incorporate this causal reasoning into a real-world system, researchers must develop an SCM comprised of a causal graph and structural equations. The graph structure describes which features are causal parents of others, which can be determined using domain knowledge and independence tests using observational data [Spirtes et al., 2000, Zhang et al., 2011, Hoyer et al., 2009]. For this paper, we assume this step has been completed using one of many graph discovery techniques. From here, structural equations must be fitted for each parent-child relationship. Recent work has suggested that Gaussian process (GP) regression can approximate the variety of relationships that occur (linear, non-linear, additive) and provide uncertainty quantification over the resulting counterfactual [Karimi et al., 2020]. This method has presently only been developed for relationships between real-valued features, and extending it to work for non-continuous child variables requires several adjustments. We explain how the probabilistic counterfactual estimation changes for binary, categorical and ordinal features. Our method is proven theoretically and validated experimentally using synthetic SCMs for ground-truth.
Counterfactual Queries
Given observation , what would have happened if had instead taken the value ? The counterfactual variable is written .
Given a fully specified SCM with nodes and equations , and an observed instance , counterfactuals asking what would have happened had we set are evaluated using the following three steps:
Three Steps for Computing Counterfactuals
-
Abduction: Use evidence and the equations to solve backwards for .
-
Action: Modify the model , by performing the intervention , to get new structural equations .
-
Prediction: Use the modified structural equations and the values of to compute the value of .
Typically, the most challenging step in this process is Abduction, because the method to isolate the factual noise depends on the form of the structural equations. The previous approach uses additive Gaussian noise, which allows for easy noise isolation Karimi et al. [2020], however this approach will not work for discrete features.
Consider a bank deciding whether to extend a loan. A continuous feature such as debt-to-income ratio determines an ordinal risk tier (subprime through super-prime, from thresholding a composite score), which in turn determines a nominal decision such as which loan product is offered. An applicant who is denied may reasonably ask what would have happened had their financial position been different. Answering this counterfactual query means carrying Abduction, Action, and Prediction through a causal chain whose structural equations mix continuous, ordinal, and nominal variables. Existing approaches are limited to scenarios with only real-valued downstream variables, leaving systems like the one described here out of their scope Karimi et al. [2020].
1.2 Existing Approaches
Prior work falls into three families, by which pipeline stage they address: discovering the graph, fitting equations on a given graph, or coupling a fixed interventional law into a counterfactual mechanism. We address the middle stage: fitting Gaussian Process equations paired with an exact noise-abduction identity. Graph discovery has begun exploiting ordinal structure to orient edges [Ni and Mallick, 2022], and Yao et al. [2025] use a categorical mechanism close to ours for graph identifiability in mixed additive noise models, without addressing counterfactual queries; we instead take the graph as given. For fitting discrete or ordinal equations, ordinal variables are classically modelled by discretising a latent score at fixed cut-points [McKelvey and Zavoina, 1975, Boes, 2013], with Chu and Ghahramani [2005] giving the Gaussian Process likelihood our construction builds on; deep generative alternatives dequantise discrete variables into normalising-flow SCMs [Pawlowski et al., 2020], or relax categorical latents via a temperature-annealed softmax [Jang et al., 2017, Maddison et al., 2017] for gradient-based training rather than exact abduction, which we use instead. A separate line instead couples a fixed interventional law: Oberst and Sontag [2019] introduce the Gumbel-max coupling, singled out axiomatically by counterfactual stability, while Lorberbom et al. [2021] learn a coupling minimising counterfactual treatment-effect variance over a query distribution; our interventional law is itself a fitted, uncertain Gaussian Process, and we choose the coupling to match the endogenous variable's type, not to optimise a downstream objective.
2 Preliminaries
2.1 Introducing Gumbel Noise
We introduce the Gumbel distribution because it gives an exact, explicit exogenous noise variable for categorical outcomes. The same construction is used to relax categorical sampling into a differentiable operation for gradient-based training via the Gumbel-softmax/Concrete distribution [Jang et al., 2017, Maddison et al., 2017]. We instead exploit its exact (non-relaxed) form to obtain closed-form noise abduction.
Gumbel Distribution [Gumbel, 1954]
if it has CDF on .
We highlight three important properties of this distribution that we will use to evaluate the counterfactuals:
• Reparameterisation: .
• Truncation [Maddison et al., 2014]: Conditioned on ,
has the conditioned law.
• Gumbel-max trick [Yellott, 1977]: For scores and iid , the perturbed maximum satisfies
2.2 Coupling and Abduction
When the structural equations are approximated by fitted GPs, the uncertainty about means that the exogenous noise driving is never observed directly. Instead, its posterior is updated (abducted) from the factual observation, and this fixed abducted noise is carried into the counterfactual world while only the parents change. For continuous nodes as in Karimi et al. [2020], one can use additive Gaussian noise that can be uniquely solved for given a factual instance.
For a discrete outcome, this uniqueness breaks. The factual and counterfactual class distributions, and , are each pinned down by the fitted model, but they alone do not determine a joint law over the pair : infinitely many joint distributions share the same two marginals. Call any such choice a coupling. Abduction is how a coupling gets realised in practice: we equip with an explicit exogenous noise variable, infer its posterior from the factual observation , and reuse that same noise, unchanged, to generate under the counterfactual parents. Because the noise realisation is shared across both worlds, the resulting joint law (the coupling) is determined entirely by how the exogenous noise is defined and abducted, which is exactly the modelling choice this paper studies for each variable type.
• Binary. A binary outcome needs only a single scalar noise , thresholded against the class probability. This is the unique coupling consistent with two Bernoulli marginals under the natural monotonicity requirement that raising the class probability cannot lower .
• Categorical. For unordered classes, one natural noise is a vector of C independent Gumbel perturbations, one per class, abducted jointly from which class won the factual “race” and reused for a second race against the counterfactual class scores. This is the Gumbel-max coupling: it treats every pair of classes symmetrically, and is the coupling characterised by counterfactual stability [Oberst and Sontag, 2019].
• Ordinal. When the classes carry an order, a different noise construction is more natural: a single shared Gaussian , pushed through the factual and counterfactual cutpoints of the same monotone threshold function. This is the comonotone coupling: since the same monotone map is applied to the same noise draw in both worlds, it respects the class ordering in a way the Gumbel-max coupling does not.
The categorical and ordinal constructions therefore abduct genuinely different exogenous noise objects (a vector of per-class Gumbels versus a single Gaussian), and so induce different couplings, even when fit to variables with the same number of classes. The one case where this distinction disappears is C = 2: with only two classes, both constructions collapse to thresholding a single uniform, so the Gumbel-max and comonotone couplings coincide exactly, and the choice between “categorical” and “ordinal” machinery becomes immaterial.
3 Results
Both propositions below instantiate the Compatibility/Abduction/Action-and-Prediction schema of §2.2; what differs is the noise object each abducts and how it is reused.
3.1 Categorical
Proposition 1 (Categorical Probabilistic Counterfactuals with Gaussian Processes). Let denote a realisation of the fitted GP latent at , and let be the normalised class-probability vector it induces. We fit independent binary Laplace GP classifiers, one per class, and renormalise: . The joint multiclass softmax fit, under which instead, is developed in §A.6.1, and Remark 2 records what differs between the two; nothing in the construction below depends on the choice, because the coupling is stated on rather than on . Write for the corresponding log-probability scores, suppressing where no ambiguity arises. Model the structural equations as:
with .
(Compatibility.) For every x and every realisation of the latent,
the softmax identity required by the schema above.
(Abduction.) Write and let be the observed class, and is the factual winning score. Conditional on and on , the posterior of is sampled exactly by
with .
(Action and Prediction.) The intervention replaces by leaving the latent process and fixed, so with ,
As the schema requires, , from which and are formed, are drawn from their joint posterior, which for each class is the bivariate Gaussian with means and and covariance
Under the one-versus-rest fit the C classifiers are independent, so the pairs are drawn independently across classes. Within a class, however, the pair must be a single draw from equation 5: is one function evaluated at two inputs, and drawing the two marginally would discard the covariance and with it Corollary 1. The counterfactual class probabilities are
approximated by Monte Carlo over draws of and, for each, a draw of from equation 3.
Corollary 1 (Consistency under the trivial intervention). In the setting of Proposition 1, intervening at the factual parent value itself, , recovers the observed factual outcome with certainty:
Corollary 2 (Binary case: closed form). Let and put with . Then equation 1 is equivalent to
the exogenous noise being .
Abduction is exact: writing ,
and with ,
Marginalising over the joint Laplace posterior of gives
3.2 Ordinal
The categorical approach assumes an unordered (nominal) set of classes, thus the Gumbel-max coupling of Proposition 1 treats every pair of classes symmetrically. We give the ordinal analogue here, built on the classical Gaussian-process ordinal-regression likelihood [Chu and Ghahramani, 2005]. This is exactly the continuous ANM-GP approach of Karimi et al. [2020], observed through a coarsened, binned channel rather than directly.
Cutpoints as a learned mechanism parameter. If the cutpoints of a variable are unknown, class boundaries can be inferred from data on the same footing as the latent function itself. Write for an unconstrained parameterisation of the cutpoints,
under which every maps to a strictly increasing tuple of cutpoints and every strictly increasing tuple arises this way, and place an independent Gaussian prior , a priori independent of and of .
Proposition 2 (Ordinal Probabilistic Counterfactuals with Gaussian Processes and Learned Cutpoints). Model the structural equation as
(13)
with , , and mutually independent a priori.
(Compatibility.) Recall that for we have the CDF: . For every and every realisation of ,
the identity required by the schema above; nothing in it uses 's non-randomness.
(Abduction.) Let and, for any realisation of , write for the interval implied by the observed class, and . Conditional on , on , and on , the posterior of is exact:
by exactly the fixed-cutpoint argument, since enters only through which interval is being conditioned on. Marginalising over the joint posterior of , the noise's posterior is the continuous mixture of truncated normals obtained by averaging equation 15 over .
(Action and Prediction.) The intervention replaces by , leaving the latent process, , and fixed, so with ,
where , , and . Since is unknown, must be drawn from their joint posterior given , approximated as Gaussian by the Laplace approximation to the ordinal likelihood equation 14 [Chu and Ghahramani, 2005], the single-latent analogue of the joint Laplace posterior in eq. equation 5, and is itself unknown, drawn from its own Laplace-Gaussian posterior (Lemma 6). The full estimator therefore marginalises over both:
approximated by nested Monte Carlo: draw from its Laplace-Gaussian posterior, refit the single-latent joint posterior of at the resulting cutpoints , draw from it, and average eq. equation 16 over both layers.
Corollary 3 (Fixed cutpoints). When the cutpoints are known rather than inferred, this means is a point mass and the outer expectation in equation 17 collapses to a single term at . Then Proposition 2 reduces exactly to fitting a single-latent GP-ordinal model at the given, fixed : this is the case used throughout Chu and Ghahramani's original construction [Chu and Ghahramani, 2005] and, prior to this section, throughout this paper.
Remark 1 (Which coupling each proposition selects). §2.2 sketches which coupling each proposition selects; here we make Proposition 2's precise. Fix a realisation of and write , non-decreasing. Eq. equation 13 gives and , both non-decreasing functions of the same scalar; with this realises as for the factual and counterfactual class distributions — the comonotone coupling (matching the monotonicity assumption used for identification in the binary [Pearl, 1999] and categorical [Lu et al., 2020] settings).
At this coincides with the Gumbel-max coupling of Proposition 1: for Bernoulli marginals the comonotone coupling is the unique one, which is why Corollary 2 admits a closed form where the general case does not — but only as couplings. The link functions still differ (probit here, logit in Corollary 2), so the two propositions agree at as couplings, not as fitted models, and they diverge for (the Experiments section measures the cost). The identification above also holds only at a fixed : after marginalising over the joint posterior of in equation 17, the estimator is a mixture of comonotone couplings over varying marginals, which need not itself be comonotone.
4 Experiments
4.1 Setup
Two fully worked examples in Appendix A.2 (Examples 1 and 2, one by hand, one against a fitted GP) walk through Abduction, Action and Prediction on a single SCM whose true mechanism happens to be exactly the Gumbel-max form of eq. equation 1. To conduct a more thorough survey of our method, we use categorical and ordinal approaches (Algorithm 1 and Algorithm 2) to compute counterfactuals on varying causal graphs depicted in Figure 1. The true structural equations of the graphs are known to us, but for our experiments we fit a sklearn Gaussian Process classifier to synthetic data generated from the true SCMs. The SCMs vary in both structural complexity and in the datatype of the endogenous nodes. We deliberately test whether each method's accuracy is confined to the case it was derived for. Using the Binary SCM, we explore the claim, from Remark 1, that both the categorical and ordinal approaches are equivalent.
These four structures can naturally occur in many systems, for example in the loan scenario ( ). The Binary SCM could be a bank's approve/deny decision from debt-to-income ratio; the Single-parent SCM, an applicant's routing to one of several loan products via an argmax over per-product suitability scores; the Interaction SCM, a risk tier from thresholding debt-to-income and loan-to-value non-additively; and the Chain SCM, the full pipeline, where debt-to-income sets the tier and both together determine which product is offered.
For each SCM we draw training samples, fit the classifier(s) with no knowledge of the true structural equations, and evaluate on 8 factual/intervention scenarios.
During the GP fitting, we bound each RBF length scale to rather than sklearn's default , whose ten-decade range causes most optimiser restarts to start far outside the data support, where the kernel is flat and fits get stuck. Under the default, the Single-parent SCM's baseline-class latent came out exactly constant ( vs. a true 0.05) and stayed there even with five times more restarts. The bounded fit attains a higher marginal likelihood, so this is a correction, not a modelling choice.
An ordinal cut-point mechanism. Our Interaction and Chain SCMs use the ordinal mechanism of Proposition 2 (eq. equation 13), with true cutpoints , . Ground truth is closed form: since the true score and are both known, eq. equation 16 is evaluated directly at , , with no Monte Carlo needed. Both fitted estimators below instead learn from data via a GP classifier, as throughout, and differ only in whether they are also given the true cutpoints or must infer them (discussed further below).
Binary
Single-parent
Interaction

Binary

Single-parent

Interaction

Chain
continuous
binary
categorical
ordinal
Figure 1: The four synthetic SCM structures used in Section 4 (Binary, Single-parent, Interaction and Chain), increasing in graph complexity and node type. Node fill color indicates each variable's data type.
Table 1: Counterfactual error and interventional error across all four synthetic SCMs, under a categorical fit and under an ordinal fit with learned cutpoints; mean sd over 10 seeds at . Mediator applies only to the Chain SCM's : whether the upstream mediator was fit as a categorical or ordinal node, isolating propagated error from 's own.
| SCM | Node type | Mediator | Categorical fit | Ordinal fit | ||
|---|---|---|---|---|---|---|
| Binary | binary | 0.021 ± 0.010 | 0.021 ± 0.014 | 0.018 ± 0.009 | 0.015 ± 0.007 | |
| Single-parent | categorical | 0.030 ± 0.010 | 0.031 ± 0.015 | 0.184 ± 0.031 | 0.173 ± 0.033 | |
| Interaction | ordinal | 0.078 ± 0.016 | 0.231 ± 0.100 | 0.045 ± 0.011 | 0.068 ± 0.040 | |
| learned cutpoints | ordinal | — | — | 0.049 ± 0.010 | 0.070 ± 0.041 | |
| Chain, | categorical | categorical | 0.070 ± 0.012 | 0.091 ± 0.017 | 0.223 ± 0.021 | 0.221 ± 0.062 |
| Chain, | categorical | ordinal | 0.070 ± 0.012 | 0.044 ± 0.020 | 0.223 ± 0.021 | 0.213 ± 0.057 |
| Chain, | ordinal | 0.037 ± 0.010 | 0.274 ± 0.074 | 0.027 ± 0.007 | 0.045 ± 0.016 | |
| learned cutpoints | ordinal | — | — | 0.029 ± 0.010 | 0.041 ± 0.024 | |
Chain (mixed mechanisms).
Computing the ground-truth counterfactual for under chains two different per-node abductions through the mediator : a truncated-normal posterior for 's noise (eq. equation 15) and a truncated-Gumbel posterior for 's (eq. equation 3).
For each experiment, we report two total-variation distances representing how well the fitted structural equation matches the true one ( ), and the counterfactual accuracy ( ). represents the distance between and the true mechanism's own class probabilities, averaged over the factual and the counterfactual parent configuration. This is the rung-two quantity that the Compatibility identities equation 2 and equation 14 guarantee any fitted model reproduces. Each entry is a mean ± standard deviation over 10 seeds at n = 500, so the spread reflects seed-to-seed variability across the whole pipeline (data, kernel fit and Monte Carlo draws together), not Monte Carlo noise alone. Appendix A.3 gives the full protocol and a Monte Carlo convergence check. Consistency error is exactly zero in every row, as Corollary 1 requires, whether or not the estimator's assumed mechanism matches the truth.
4.2 Findings
Misspecification is invisible to the fit — but only in one direction, and only partly correctable. Fitting the categorical estimator to data whose true mechanism is the ordinal cut-point model (the Interaction SCM, the Chain SCM's mediator) leaves at the same order as the correctly specified rows, while is still off by roughly 0.25 (Table 1). Refitting these nodes with Proposition 2's ordinal estimator recovers most of that gap, by factors of 3.4 and 6.1, while moves by far less. The Chain SCM's terminal node makes this sharpest: its own mechanism was never misspecified and its fitted equation is unchanged between the two arms, yet its counterfactual accuracy improves because it is fed a more accurate mediator counterfactual. What residual error remains once the coupling is right is ordinary GP estimation difficulty. The Interaction SCM's higher error against the Single-parent SCM's reflects the interaction term being a harder two-dimensional surface to learn from 500 samples than the Single-parent SCM's additive score. In the reverse direction, fitting the ordinal estimator to genuinely nominal Gumbel-max data (the Single-parent SCM, the Chain SCM's terminal node) degrades itself, by a factor of six on the Single-parent SCM ( ), because forcing a monotone latent score onto classes with no true order is a harder regression problem outright, not merely the wrong label on a well-fit one. Imposing order costs the fit; imposing nominality does not.
The binary control. As §2.2 and Remark 1 predict for the case where the two couplings coincide, refitting the Binary SCM with the matching probit link barely moves , well inside one standard deviation across seeds, in sharp contrast to the large drop that correcting a genuine mismatch produces at the Interaction SCM (Table 1).
Learned cutpoints cost almost nothing. The indented “learned cutpoints” rows infer b jointly with g (Proposition 2’s general construction) instead of being given the true , (Corollary 3’s fixed-cutpoint case), yet the two are indistinguishable within seed noise. This is valuable for cases when a variable is known to be ordinal, but the cutpoints are not defined, such as the risk-tiers in the loan example.
More data does not fix the wrong coupling. Repeating the sweep at four training-set sizes, to 1000 (Table 2, Appendix A.4), shows and falling together where the coupling is correct, as ordinary GP asymptotics predict, but diverging where it is wrong: keeps improving while flattens onto a floor near 0.21–0.24, so their ratio grows with under misspecification instead of staying near 1. The error is not a small-sample artefact more data would remove: the fit would pass any diagnostic applied to it, yet the counterfactual remains wrong by a fixed amount. The coupling family is a modelling decision that must be made on structural grounds, not one the observational fit can be trusted to reveal at any sample size.
Ablating the estimator confirms the coupling, not the GP, is responsible. Table 3 (Appendix A.4) separates abduction, coupling and posterior averaging on the two single-node SCMs: abduction is what does the work (skipping it costs an order of magnitude in accuracy on the Single-parent SCM), posterior averaging contributes almost nothing to the point estimate, and an oracle given the true class probabilities still recovers only about a tenth of the misspecification error at the Interaction SCM — roughly nine tenths of it is the coupling, not the GP.
5 Discussion
Propositions 1 and 2 agree on every observational and interventional quantity and disagree only about the counterfactual, by construction. This is the content of the two Compatibility identities, and Remark 1 identifies the two couplings responsible. §4 puts numbers on this gap and its direction-dependent visibility to the fit. Either way, the mechanism is a modelling choice made above the fitted model, not a parameter the fit can be relied on to recover.
This raises the question of how the choice should be made. Lorberbom et al. [2021] answer it by optimising a downstream objective, since no experiment can adjudicate the choice directly. Our results argue an objective alone is not enough: §4 shows a good observational and interventional fit does not imply a correct counterfactual, since mismatched couplings can agree on both while still diverging sharply downstream. We instead let the variable's type, known before any objective is specified, constrain the admissible couplings, and find this constraint the more consequential of the two: the gap between type-appropriate couplings dwarfs the gains reported from tuning within a single family.
Two limitations follow. First, our validation is against synthetic SCMs with known mechanisms; on real data the exact mechanism is not observable, though the gap is narrower than it sounds: choosing the coupling only requires knowing the variable's type — whether its categories carry an order — not its structural equation, and type is ordinary domain knowledge even when the mechanism is not. Second, the constraint is structural: Lorberbom et al. [2021] show no mechanism that abducts noise once and reuses it across interventions can be optimal simultaneously for every pair of interventional distributions, so neither proposition is uniformly best, each being the natural choice for its variable type. Proposition 2 already relaxes one candidate restriction by inferring cutpoints jointly with the latent function, with Corollary 3 recovering the fixed-cutpoint case exactly and costing almost nothing in practice (§4). Extending the construction to latent functions shared across correlated ordinal nodes remains a natural next step.
6 Conclusion
We introduced a unified probabilistic framework for counterfactual inference in GP-SCMs with heterogeneous variable types, deriving exact noise-abduction procedures for binary, categorical, and ordinal outcomes and proving that each reproduces its fitted model's observational and interventional distributions exactly. Across a suite of synthetic SCMs with known ground truth, we showed that the choice of coupling, not the quality of the underlying GP fit, is what determines counterfactual accuracy: two estimators that agree on every observational and interventional quantity can disagree by a total variation distance of roughly 0.25 on the counterfactual, an error that does not shrink with more data. This gap is invisible to goodness-of-fit when ordinal data is mistaken for categorical, but not in reverse: forcing a false order onto categorical data degrades the fit itself, so the two directions of misspecification are detected differently but corrected the same way. Because a variable's type constrains the admissible couplings before any data is seen, that structural knowledge, not a downstream fitting criterion, is what should guide the choice.
Reproducibility statement
Our theoretical claims are proved in full in Appendix A.6, with assumptions stated alongside each result and the Gaussian process background they build on recalled in Appendix A.1. All experiments use synthetic SCMs whose generating equations are given explicitly in §4 and Appendix A.2, so exact ground-truth counterfactuals are available in closed form rather than estimated; the full training and evaluation protocol (sample sizes, seeds, and Monte Carlo budgets) is specified in Appendix A.3, and a Monte Carlo convergence check is included there.
Acknowledgments
This research was supported in part by the Natural Sciences and Engineering Research Council of Canada (NSERC) under grant to both MK and AHK.
References
Christopher M. Bishop. Pattern Recognition and Machine Learning. Springer, 2006.
Stefan Boes. Nonparametric analysis of treatment effects in ordered response models. Empirical Economics, 44(1):81–109, 2013.
Wei Chu and Zoubin Ghahramani. Gaussian processes for ordinal regression. Journal of Machine Learning Research, 6:1019–1041, 2005.
Emil Julius Gumbel. Statistical Theory of Extreme Values and Some Practical Applications: A Series of Lectures, volume 33 of National Bureau of Standards Applied Mathematics Series. U.S. Government Printing Office, Washington, D.C., 1954.
Patrik O. Hoyer, Dominik Janzing, Joris M. Mooij, Jonas Peters, and Bernhard Schölkopf. Nonlinear causal discovery with additive noise models. In Advances in Neural Information Processing Systems 21 (NeurIPS), pages 689–696, 2009.
Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with Gumbel-softmax. In International Conference on Learning Representations (ICLR), 2017.
Amir-Hossein Karimi, Julius von Kügelgen, Bernhard Schölkopf, and Isabel Valera. Algorithmic recourse under imperfect causal knowledge: A probabilistic approach. In Advances in Neural Information Processing Systems 33 (NeurIPS), pages 265–277, 2020.
Guy Lorberbom, Daniel D. Johnson, Chris J. Maddison, Daniel Tarlow, and Tamir Hazan. Learning generalized Gumbel-max causal mechanisms. In Advances in Neural Information Processing Systems 34 (NeurIPS), 2021.
Chaochao Lu, Biwei Huang, Ke Wang, José Miguel Hernández-Lobato, Kun Zhang, and Bernhard Schölkopf. Sample-efficient reinforcement learning via counterfactual-based data augmentation. arXiv preprint arXiv:2012.09092, 2020.
David J. C. MacKay. The evidence framework applied to classification networks. Neural Computation, 4(5): 720–736, 1992.
Chris J. Maddison, Daniel Tarlow, and Tom Minka. A* sampling. In Advances in Neural Information Processing Systems 27 (NeurIPS), pages 3086–3094, 2014.
Chris J. Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. In International Conference on Learning Representations (ICLR), 2017.
Richard D. McKelvey and William Zavoina. A statistical model for the analysis of ordinal level dependent variables. The Journal of Mathematical Sociology, 4(1):103–120, 1975.
Yang Ni and Bani Mallick. Ordinal causal discovery. In Proceedings of the Thirty-Eighth Conference on Uncertainty in Artificial Intelligence (UAI), 2022.
Michael Oberst and David Sontag. Counterfactual off-policy evaluation with Gumbel-max structural causal models. In Proceedings of the 36th International Conference on Machine Learning, volume 97 of PMLR, pages 4881–4890, 2019.
Nick Pawlowski, Daniel C. Castro, and Ben Glocker. Deep structural causal models for tractable counterfactual inference. In Advances in Neural Information Processing Systems 33 (NeurIPS), 2020.
Judea Pearl. Probabilities of causation: three counterfactual interpretations and their identification. Synthese, 121(1):93–149, 1999.
Judea Pearl, Madelyn Glymour, and Nicholas P. Jewell. Causal Inference in Statistics: A Primer. John Wiley & Sons, 2016.
Carl Edward Rasmussen and Christopher K. I. Williams. Gaussian Processes for Machine Learning. MIT Press, Cambridge, MA, 2006.
Peter Spirtes, Clark Glymour, and Richard Scheines. Causation, Prediction, and Search. MIT Press, 2nd edition, 2000.
Christopher K. I. Williams and David Barber. Bayesian classification with Gaussian processes. IEEE Transactions on Pattern Analysis and Machine Intelligence, 20(12):1342–1351, 1998.
Ruicong Yao, Tim Verdonck, and Jakob Raymaekers. Causal discovery in mixed additive noise models. In Proceedings of the 28th International Conference on Artificial Intelligence and Statistics (AISTATS), volume 258 of PMLR, 2025.
John I. Yellott. The relationship between Luce's choice axiom, Thurstone's theory of comparative judgment, and the double exponential distribution. Journal of Mathematical Psychology, 15(2):109–144, 1977.
Kun Zhang, Jonas Peters, Dominik Janzing, and Bernhard Schölkopf. Kernel-based conditional independence test and application in causal discovery. In Proceedings of the Twenty-Seventh Conference on Uncertainty in Artificial Intelligence (UAI), pages 804–813, 2011.
A Appendix
A.1 Definitions
Definition 1 (Gaussian Process Prior [Rasmussen and Williams, 2006]). A Gaussian process (GP) is a collection of random variables, any finite number of which have a joint Gaussian distribution. A GP is completely specified by its mean function and covariance function , defined as:
We denote the GP prior over functions as
For notational convenience the mean function is often taken to be zero.
Definition 2 (Gaussian Process Posterior [Rasmussen and Williams, 2006]). Let be training observations with , , and let . The joint prior over training targets and test function values at inputs is:
Conditioning on the observations yields the GP posterior predictive distribution:
For a single test point with , these reduce to:
A.2 Worked Numerical Example
Example 1 (Worked numerical example of the three-step procedure). We walk through Abduction, Action and Prediction for a single categorical node with classes , treating the fitted GP latent as known exactly at the factual and counterfactual parent values (the Compatibility case of Proposition 1), so that and below are fixed score vectors rather than posterior draws.
Setup. Let have a single scalar parent, so that is one number, and fix the intervention up front: the factual parent value is and we intervene with at . The intervention is on the parent, not on itself; the class taken by is what the three steps below compute. Both score vectors are outputs of the already-fitted classifier, read off at these two inputs through , and neither is chosen at counterfactual time.
At the factual input the classifier gives , so and the observed factual outcome is . At the intervened input it gives , i.e. — moving the parent from 0.5 to 2.5 makes class 3, not class 1, the most probable outcome.
- Abduction (eq. equation 3). Since is normalised, . Suppose the sampler draws for the factual winning score :
This fixes . For the two losing classes, drawing and and writing ,
The abducted noise vector is , held fixed for the remaining steps.
-
Action. The intervention replaces by in the structural equation equation 1, giving the modified equation with unchanged.
-
Prediction (eq. equation 4). Adding the fixed noise to the post-intervention scores,
so : although class 1 was the observed factual outcome and class 3 was the least likely class factually, the noise realisation abducted from the factual observation, carried through to the new scores under the intervention, makes class 3 the counterfactual outcome. As a check, intervening at the factual value itself, , replaces by and recovers for every draw, as required by consistency (Corollary 1, eq. equation 2).
Example 2 (Empirical validation against a known ground truth). Example 1 fixes the scores , by hand. Here we instead generate data from a known SCM, fit a genuine Gaussian Process classifier to it, run the full estimator of Proposition 1 (including the joint-latent Monte Carlo average of eq. equation 6, not the point-estimate simplification of Example 1), and compare the result against the exact counterfactual computed from the known structural equations.
The SCM. One continuous parent and one 3-way categorical child, the simplest instance of Proposition 1 that is not binary:
with : positive favours class 2, negative favours class 3, and class 1 is a constant baseline.
Pipeline. We draw samples from this SCM and fit an sklearn GaussianProcessClassifier with an RBF kernel to . For the factual instance , and the intervention , the fitted model's counterfactual class distribution (Monte Carlo over 4,000 draws of the joint latent and the abducted noise) is compared against the exact ground-truth distribution obtained by abducting from the known (the same identity as eq. equation 3, applied to instead of a fitted ):
The GP estimate evaluates the counterfactual as:
While the ground truth is:
Both agree that the counterfactual class is 3 and the total variation distance between the fitted estimate and the ground truth is only 0.022. As a consistency check, re-running the same fitted estimator with the trivial intervention places probability 1.0 on class 2, confirming eq. equation 2 holds empirically for the fitted model as well as for the true one.
A.3 Experimental Protocol
Each entry in Table 1 is a mean standard deviation over 10 random seeds at : each seed redraws the training data, refits every Gaussian Process, and re-runs all 8 factual/intervention scenarios, so the reported spread reflects sampling variability across the whole pipeline (data, kernel fit and Monte Carlo draws together). For example, the mismatched arm of the Interaction SCM ranges from 0.11 to 0.41 across the ten seeds.
Every counterfactual probability is itself a Monte Carlo average over 4,000 draws of the joint latent and the abducted noise. This budget is comfortably converged: re-running the Interaction SCM at from 250 to 16,000 moves by only between the first two budgets and by at most 0.0015 beyond 2,000, two orders of magnitude below the seed-to-seed standard deviation of 0.100. Monte Carlo error is therefore not what the reported spread is measuring.
A.4 Additional Ablations
More data does not fix the wrong coupling. Table 2 repeats the sweep at four training-set sizes, and separates the two kinds of error cleanly. Where the coupling is correct, both quantities fall with as ordinary GP asymptotics predict: the Single-parent SCM goes from 0.061 to 0.021 between and , the Chain SCM's refitted mediator from 0.055 to 0.022. Where the coupling is wrong, the fit keeps converging while the counterfactual does not. The Interaction SCM's falls by over that range and the Chain SCM's mismatched mediator by , but their barely moves, and , flattening onto a floor near .
The ratio therefore grows with sample size when the coupling is misspecified (from 1.8 to 3.7 on the Interaction SCM, and from 3.1 to 10.2 on the Chain SCM's mediator), while staying near 1 in every correctly specified row. This is the sharpest form of the point. The error is not a small-sample artefact that more data would remove: the structural equation converges to the truth, the goodness of fit improves monotonically and would reassure any diagnostic applied to it, and the counterfactual remains wrong by a fixed amount. The coupling family is a modelling decision that must be made on structural grounds; it is not one the observational fit can be trusted to reveal, at any sample size.
Table 2: Counterfactual error against training-set size, mean over 10 seeds. Rows marked use an estimator whose coupling does not match the true mechanism; their error flattens rather than falling with .
| arm | n = 100 | n = 250 | n = 500 | n = 1000 |
|---|---|---|---|---|
| Binary (probit) | 0.040 | 0.022 | 0.021 | 0.015 |
| Single-parent (Gumbel-max) | 0.061 | 0.045 | 0.031 | 0.021 |
| Interaction (ordinal) | 0.253 | 0.226 | 0.231 | 0.207 |
| Chain, (Gumbel-max) | 0.119 | 0.084 | 0.091 | 0.071 |
| mediator (ordinal) | 0.279 | 0.249 | 0.274 | 0.242 |
| Binary, refit | 0.039 | 0.021 | 0.014 | 0.013 |
| Interaction, refit | 0.083 | 0.094 | 0.068 | 0.055 |
| Chain, refit, | 0.081 | 0.056 | 0.044 | 0.024 |
| mediator | 0.055 | 0.036 | 0.045 | 0.022 |
What each ingredient contributes. The table above varies the SCM and holds the estimator fixed; Table 3 does the reverse, on the two single-node SCMs, Single-parent and Interaction, and separates the three things the estimator does: abduct an exogenous noise, couple it through the intervention, and average over the GP posterior.
Abduction is what does the work. Evaluating the fitted classifier at the intervened parents and ignoring the factual outcome entirely (the “resample independently” baseline) gives on the Single-parent SCM, an order of magnitude worse than the 0.031 of the full estimator. Conditioning the latent on the factual outcome without abducting an exogenous noise scarcely helps (0.300): it lands on top of the interventional baseline, which is the behaviour one expects, since a latent shared with the factual world constrains the probabilities but leaves the realised outcome free to be redrawn.
Averaging over the GP posterior, by contrast, contributes almost nothing to the point estimate: replacing the draws by the posterior mean latent leaves unchanged to three decimals on both SCMs (0.031 against 0.031, 0.232 against 0.231). We report this as a negative result about our own construction. It does not license dropping the joint draw: the pair must still come from the joint posterior, since it is the shared latent that makes Corollary 1 hold exactly, and a plug-in mean discards the posterior spread that any credible interval on the counterfactual would need. What the comparison shows is that marginalising buys calibration, not accuracy, at these sample sizes.
The oracle isolates the coupling. The last row replaces the fitted class probabilities with the true ones, leaving everything else alone, so any error it still makes is attributable to the coupling and to nothing else. On the Single-parent SCM, whose true mechanism is Gumbel-max, the oracle error falls to , the Monte Carlo floor at 4,000 draws, which is the check that the oracle is doing what it claims. On the Interaction SCM it falls only from 0.231 to 0.205. Exact probabilities recover about a tenth of the misspecification error and leave the rest untouched: roughly nine tenths of it is the coupling, not the Gaussian Process. Together with Table 2 this closes the argument from both directions: neither more data nor perfect probabilities repairs the wrong coupling.
Table 3: Counterfactual error for five estimators on the same data, mean sd over 10 seeds at . The Single-parent SCM's true mechanism is Gumbel-max, matching the coupling; the Interaction SCM's is the ordinal cut-point model, so the coupling is misspecified.
| estimator | Single-parent | Interaction |
|---|---|---|
| interventional (no abduction) | 0.295 ± 0.079 | 0.434 ± 0.051 |
| latent-only abduction | 0.300 ± 0.080 | 0.430 ± 0.051 |
| plug-in posterior mean | 0.031 ± 0.014 | 0.232 ± 0.102 |
| full estimator (ours) | 0.031 ± 0.015 | 0.231 ± 0.100 |
| oracle: true p, same coupling | 0.005 ± 0.001 | 0.205 ± 0.092 |
A.5 Algorithms
Algorithms 1 and 2 give the two estimators in the form they are implemented. Both follow the same skeleton — fit, compute the joint posterior moments once, then repeat abduction, action and prediction inside a Monte Carlo loop that marginalises over the uncertainty in the latent — and differ only in the exogenous noise and how it is abducted.
Fixing to a point mass at some (so and deterministically) recovers the fixed-cutpoint algorithm of Corollary 3 exactly, the Training step reducing to a single Laplace fit at the given .
Two implementation details are worth stating, because both are easy to get wrong and neither is visible in the equations. First, the pair on line 9 of Algorithm 1 must be a single draw from the joint posterior; drawing the two marginally discards the covariance equation 5 and destroys the exact consistency of Corollary 1. When a whole response curve is traced over a grid of interventions, the draws should additionally share one random-number stream across grid points, for the reason given in Remark 3. Second, the abduction on line 15 is written with logaddexp rather than as : the two are identical in exact arithmetic, but the first is a sum inside the logarithm and so neither cancels nor overflows, whereas
Algorithm 1 Counterfactual for a categorical node (Proposition 1)
Require: sample ; factual ; intervention ; draws
Ensure: for
Training
1: for do
2: fit a binary Laplace GP classifier for class against the rest one-versus-rest; Remark 2
3: end for
Posterior moments — independent of the draw, so computed once
4: for do
5: joint two-point Laplace moments at , eq. equation 5
6: end for
7:
8: for do
9: for do
10: draw jointly from the bivariate Gaussian above one draw, both inputs; classes independent
11: end for
12: , coupling lives on
Abduction — eq. equation 3
13: ; the factual winning score
14: ;
15: ; for
Action and prediction
16: ;
17: end for
18: return
Algorithm 2 Counterfactual for an ordinal node with learned cutpoints (Proposition 2)
Require: sample; cutpoint prior (eq. equation 12); factual ; intervention ; outer draws ; inner draws
Ensure: for
Training
1: fit by Laplace-approximating the profiled cutpoint posterior Lemma 6
2:
3: for do marginalise over the cutpoint posterior
4: draw ; set via eq. equation 12
5: fit one latent GP under the ordinal-probit likelihood equation 14 at these cutpoints, by Laplace approximation Lemma 5
6: joint two-point moments at under this fit
7: for do marginalise over the GP posterior
8: draw jointly from the bivariate Gaussian above
Abduction — the factual class confines to one interval, eq. equation 15
9: ;
Action and prediction — eq. equation 16; is integrated out in closed form rather than sampled
10: for do
11:
12: end for
13: end for
14: end for
15: return the naive form loses precision exactly for classes that were probable factually yet lost the argmax — the individuals whose counterfactuals are most interesting.
For a multi-node SCM the two algorithms are applied per node in topological order, each node abducting its own exogenous noise from its own factual parents and outcome, and the sampled counterfactual of a parent feeding the next node's intervened input.
A.6 Proofs
Throughout, denotes the observational sample, the factual individual, and where we write for its index. We write for the -th standard basis vector, for the all-ones vector, and reserve for the counterfactual parent configuration. All statements are made for a fixed with non-empty parent set ; the subscript is suppressed wherever no ambiguity arises.
For the discrete results of §A.6.2, denotes a vector of log-probability scores entering a arg max over classes, and denotes the value of that maximum. We deliberately avoid and for these objects: in the recourse literature [Karimi et al., 2020] is an action and is the SCM itself, and neither is what is meant here. The Gumbel vector plays the role of the exogenous of that paper's equation (1); we retain because is used in Corollary 2 for the induced scalar uniform noise of the binary mechanism.
A.6.1 Laplace machinery for the multiclass GPC
Notation and ordering conventions. For C > 2 the latent object is the nC-vector collecting C latent values per training point, and two orderings are in circulation. Write
where and is the permutation sending index to . Since are independent GPs sharing the kernel , the prior covariance of is
Let have -th entry , let be the class-ordered stack of the , and let be the corresponding stack of , where , the softmax reduction noted in Proposition 1's preamble below.
The following lemma is the machinery behind the multiclass Laplace posterior used throughout Proposition 1 below, whose joint covariance is displayed there as eq. equation 5; this general machinery is not itself exposed as a separate main-text equation, so it is derived here in full, and used directly in the proof of Proposition 1 in §A.6.2.
Lemma 1 (Strict concavity, the MAP equation, and the Laplace predictive). Let be the unnormalised log posterior of the multiclass GPC model, i.e. of the bare softmax likelihood without the Gumbel-max coupling of Proposition 1's eq. equation 1, with . Then:
(i) and , where is the matrix with and (derived below);
(ii) , with null space of dimension ;
(iii) is strictly concave, hence has a unique maximiser , characterised for each by
(iv) the Laplace approximation to the latent posterior is (the general multiclass Laplace posterior, of which the joint covariance needed in Proposition 1's eq. equation 5 is a two-point specialisation), and the induced predictive law at any input has, per class,
with , and . More generally, for two inputs ,
Proof. (i) The bare softmax likelihood factorises over training points, so
the constant absorbing . Differentiating the -th bracket in gives , which stacks to ; differentiating gives . Differentiating once more, the second derivative of the -th bracket with respect to is , and mixed derivatives across distinct training points vanish because the likelihood factorises.
(ii) For with point-ordered blocks ,
The variance in equation 32 vanishes iff is constant in for each (as for all ), i.e. iff ; the null space of therefore has dimension exactly . This degeneracy is the shift-invariance of the softmax, .
(iii) By (i) and (ii), everywhere, since and . Hence is strictly concave and, being coercive, attains a unique global maximum . Note that it is the GP prior, not the likelihood, that removes the softmax degeneracy and makes the MAP well defined. Setting gives , i.e. . Since is block diagonal in the class-ordered layout, this decouples across into equation 28.
(iv) Since , the second-order Taylor expansion of at its mode is ; exponentiating and normalising the quadratic part gives the stated Gaussian [Williams and Barber, 1998, Rasmussen and Williams, 2006], whose covariance is well defined because by (ii)–(iii) notwithstanding the singularity of . For the predictive moments, by the GP prior; marginalising over with the laws of total expectation and total variance and using equation 28 gives the mean in equation 29, while the variance follows on approximating the -th diagonal block of by and applying the Woodbury identity , legitimate because makes invertible. Equation equation 30 is the same computation with and in the two slots.
Remark 2 (One-versus-rest predictive moments). Lemma 1 concerns the joint multiclass Laplace approximation with a softmax likelihood. The implementation evaluated in §4 instead fits independent binary Laplace classifiers and renormalises, and equation 29–equation 30 do not apply to it verbatim: there each class has its own bivariate Gaussian posterior over , obtained from that class's own binary Laplace fit, and the classes are independent. As established in the proof of Proposition 1, this changes how is estimated but not the counterfactual construction, because the coupling is stated on . The compatibility identity, the abduction of Lemma 3 and Corollary 1 all go through unchanged; only the accuracy of is affected — which is exactly what the column of §4's table measures. At the two approximations coincide and Corollary 2 applies as stated.
A.6.2 Proof of Proposition 1, Corollary 1 and Corollary 2
Lemma 2 (Gumbel-max representation [Gumbel, 1954, Yellott, 1977]). Let be any score vector and . Then
and the arg max and the max are independent.
Proof. with . By independence, , which is the second claim. For the first, condition on and integrate:
Substituting , , the integrand becomes on , whence equation 34 equals . Independence of the arg max and the max is the standard consequence of the same computation, the conditional law of the maximum given being free of .
Lemma 3 (Posterior of the Gumbel vector given the realised class [Maddison et al., 2014]). In the setting of Lemma 2, condition on . Let . Then , and given the coordinates are conditionally independent with
Consequently equation 3 samples the posterior exactly.
Proof. The event is . Given , the coordinate is determined, , and the remaining coordinates are independent (by independence of the ) each conditioned on the event , i.e. . That unconditionally, and independently of the arg max, is Lemma 2; hence its conditional law given is the same. For the sampler, if conditioned on then its CDF is for ; setting this equal to and solving gives , i.e. , which with is the expression in equation 3. Note almost surely, so the logarithm is well defined.
Proof of Proposition 1. Compatibility. Apply Lemma 2 with . For any probability vector ,
so equation 33 gives equation 2 directly, for arbitrary p. Since is independent of the latent and of everything upstream, and removes only the equations for ,
so equation 1 matches the fitted model on all observational and interventional distributions.
The coupling must sit on , not on . Under the joint Laplace fit, , so
with a shift invisible to , so coupling on or on agree. Under a one-versus-rest fit, , so in general and coupling on would violate equation 2; only works for both.
Abduction. Equation equation 1 is a structural equation with exogenous, unit-specific and independent across units, so Step 1 asks for . Given , Lemma 3 with , gives exactly equation 3. Since is normalised, and here; equation 3 retains the general location because it also holds for unnormalised scores.
Action and prediction. Fixing , and substituting the argument gives equation 4. As only the Laplace posterior of is known, is drawn jointly, with moments given by Lemma 1(iv) — equation 29, equation 30 at , — the covariance being equation 5. Taking expectation of the indicator in equation 4 over , then ,
gives equation 6. The integrand is a bounded indicator, so the Monte Carlo estimator is unbiased and converges with probability 1 by the strong law of large numbers; each draw is a vertex of , so the empirical average lies in at every finite sample size and is a valid categorical distribution.
The pair in abduction equation 35 and prediction equation 4 must be the same draw: is one function evaluated at two inputs. Independent draws discard the covariance equation 5, severing the shared latent needed for Corollary 1.
Proof of Corollary 1. Set , so in equation 30. Then
Since is a deterministic function of , equation 40 gives
By Lemma 3, conditioning the abduction on gives, with ,
the inequality strict almost surely, since the conditioned Gumbel distribution is continuous and so assigns zero probability to any exact value — an exact tie between two classes would be one such value, so ties simply do not occur. Substituting equation 41 into equation 42, the comparison is unchanged under :
SO
Since this indicator equals almost surely, averaging it in equation 6 returns the point mass at , which is equation 7.
Remark. Two points bear on the implementation. Equation equation 40 requires and to be the same posterior draw; sampling them independently from their marginals breaks it. And equation 44 uses no property of beyond being a probability vector, so an empirical failure of consistency diagnoses the coupling, not the fit.
Proof of Corollary 2 (binary closed form). Reduction. At , shift-invariance of the arg max under lets us write the event as with . The difference of two independent standard Gumbels is standard logistic: for ,
(45) by the substitution , which turns the integral into . Setting , which is Uniform(0,1) because is the CDF of , and using strict monotonicity of ,
which is equation equation 8.
Abduction. By equation 46 the observation is equivalent to , and to . Since is uniform and independent of , its posterior is the uniform law restricted to the corresponding interval, which is equation equation 9. Note that this abduction is exact: no approximation intervenes between the observation and the posterior of the exogenous variable.
Prediction. Conditional on , and hence on and , the counterfactual event is with drawn from equation 9. If then and
while if then and
which together are equation equation 10. Marginalising over the joint Laplace posterior of , whose moments are equation 29-equation 30 at C = 2, gives equation equation 11.
Consistency and monotonicity. Setting gives almost surely, so equation 47 equals 1 and equation 48 equals 0, the direct consequence of Corollary 1. Moreover both expressions are non-decreasing in , so the counterfactual probability is monotone in the intervention whenever is, and here holds exactly and pathwise.
Remark 3 (Common random numbers in the Monte Carlo estimator). When equation 6 or equation 11 is evaluated over a grid of intervention values in order to trace a counterfactual response curve, the draws of should share a common random number stream across grid points. The per-point marginals are unaffected — the draws are merely correlated across the grid — but the resulting curve is smooth rather than jittery, which preserves the exact monotonicity established in the proof of Corollary 2 at practical sample sizes. Independent draws per grid point leave a Monte Carlo residual that can locally violate monotonicity by .
A.6.3 The probit approximation
The following is used when a closed form is wanted in place of the Monte Carlo average in equation 11, at the cost of an additional approximation. It is stated separately because, unlike Corollary 2, it is not exact.
Lemma 4 (Gaussian-probit convolution). For , and ,
Proof. Let be independent of . Since , conditioning on and applying the tower rule gives
By independence, , so the right-hand side of equation 50 equals .
Remark 4 (Where the probit approximation may and may not be used). Lemma 4 with — the scale matching to to first order at the origin, since [MacKay, 1992, Bishop, 2006] — yields the familiar closed form for the interventional class probability itself — the quantity obtained by evaluating the fitted mechanism at and averaging over the latent posterior. It does not give a closed form for equation 11. The reason is that equation 47-equation 48 are non-linear in the pair through min, max and the ratio, so the expectation over the joint posterior does not reduce to a one-dimensional Gaussian integral of a probit. Applying Lemma 4 separately to and and substituting the results into equation 10 computes in place of , which by Jensen's inequality is biased in general; in particular it destroys the exact consistency of Corollary 1, since the substitution no longer forces pathwise. We therefore retain the Monte Carlo form in equation 11. Where differentiability of the estimator is required, the reparametrised draws of are themselves differentiable in , so pathwise gradients are available without the probit step.
A.6.4 Proof of the ordinal-GP counterfactual proposition
Numbering. This subsection proves Proposition 2. Equation equation 12 is the cutpoint reparameterisation, equation 13 the ordinal structural equation, equation 14 the compatibility identity, equation 15 the abduction of , equation 16 the prediction given the latent and , and equation 17 the marginalisation over the joint posterior of . Lemma 6, proved below alongside Lemma 5, supplies the Laplace-Gaussian posterior over that this marginalisation draws from. Corollary 3 is proved at the end of this subsection.
Throughout, denote the standard normal CDF and density. For a fixed realisation of , write for the cutpoints of eq. equation 13 at that via equation 12; as elsewhere in this appendix, all statements are for a fixed with the subscript suppressed.
Lemma 5 (Laplace approximation for the ordinal-probit likelihood [Chu and Ghahramani, 2005]). Fix a realisation of and write . Let be the likelihood of observing class given latent value , and let be the unnormalised log posterior of the single-latent GP-ordinal model equation 13 at that . Because is a function of alone, and with diagonal, , where
, (with , and as ). Chu and Ghahramani [2005] give this construction — their Laplace approximation — together with a treatment of the resulting Newton iteration; where at the mode (as it is for every fit reported in the validation section of the main text, verified numerically), the mode is characterised by , the Laplace posterior is , and the induced predictive law at any two inputs is jointly Gaussian with
the single-latent specialisation of Lemma 1(iv) with the softmax likelihood's (e−π) and per-class replaced by and above — the two constructions coincide once the block-diagonal structure of the multiclass case is set aside, since both are Newton–Laplace approximations to a likelihood that factorises over training points. Nothing above uses that is fixed rather than random: the statement holds conditionally on any realisation of , cutpoints playing the same role as any other given, fixed constant vector.
We take Lemma 5 as given and do not re-derive the concavity or convergence properties of the Newton iteration; those are exactly the content of Chu and Ghahramani [2005] and are orthogonal to what follows, which is the counterfactual construction on top of the fitted latent – the same division of labour adopted for the one-versus-rest categorical fit.
Lemma 6 (Laplace approximation for the cutpoint posterior). Let and be as in Lemma 5, and let denote the Laplace log marginal likelihood of Lemma 5 evaluated at — the quantity Lemma 5's Newton iteration already produces for any fixed , since profiling out f requires no assumption on how itself was chosen. Let
By the envelope theorem, since at for every , the total derivative equals the partial derivative of in holding fixed: the gradient of the profiled objective sees only through the explicit appearance of in the per-point likelihoods, with no term from . The Hessian does not enjoy this simplification: differentiating the stationarity condition implicitly gives
the single-latent analogue of the implicit-function step used to differentiate a GP’s marginal likelihood with respect to its kernel hyperparameters [Rasmussen and Williams, 2006, §5.5.1], and carries a corresponding correction term through this Jacobian. The Laplace approximation to the profiled cutpoint posterior is then
Remark 5 (Numerical versus symbolic Hessian). The correction term in above is exact but need not be coded symbolically: since is low-dimensional throughout this paper's experiments ( ), in equation 53 is instead obtained by numerically differentiating (central finite differences), which is the same quantity up to truncation error and avoids re-deriving and re-implementing in code.
Proof of the ordinal proposition. Compatibility. Fix any realisation of and write . Since is independent of by construction of equation 13, , and iff . Hence , which is equation 14; this is the defining likelihood of Lemma 5 at that , so no additional argument is needed. As is exogenous and independent of everything upstream, the same identity evaluated at is the interventional law, so equation 13 is compatible with any fitted exactly as Proposition 1 is compatible with any fitted : nothing about being the ordinal link, as opposed to a fitted probit or any other calibrated classifier's own class probabilities, is used in this half of the argument, and nothing in it uses 's non-randomness – averaging equation 14 over the joint posterior of still reproduces the fitted model's own law by the tower rule.
Abduction. Fix any realisation of and write , , and condition on . The event is, given and , exactly , since . Because is a priori and independent of , and the only information the conditioning event carries about is that it lies in this interval, Bayes' rule gives the posterior of as its prior restricted and renormalised to the interval, i.e. a truncated standard normal. This is equation 15, and it is exact conditional on : no approximation intervenes between the observation and the posterior of the exogenous variable at a given , exactly as in the Abduction paragraph of Corollary 2's proof, with the interval-restricted standard normal in place of the interval-restricted uniform. Since itself is not known, the noise's actual posterior is obtained by the tower rule, averaging equation 15 over the joint posterior of given the data and the factual observation – a continuous mixture of truncated normals rather than a single one, since different draws truncate to different intervals.
Action and prediction. Fix any realisation of . The intervention replaces by and leaves , and untouched, so with the counterfactual latent is , the same as abducted in equation 15. Writing , , so with , ,
(54) which, writing the intersection’s endpoints as and and clipping a possibly empty intersection to probability zero via , is exactly equation 16 — the same overlap-of-two-intervals computation as equation 47-equation 48, now for two general intervals under a standard normal rather than two half-lines under a uniform, and conditional on exactly the fixed-cutpoint computation. Since is not known but only its Laplace posterior given is (Lemma 5), the pair must be drawn from that joint posterior and the indicator averaged over it. And since is not known either, only its Laplace-Gaussian posterior equation 53 (Lemma 6) is, itself must be drawn and the whole construction – refit ’s joint posterior at the resulting , draw from it, evaluate equation 16 – repeated per draw, giving the nested average equation 17. The nested Monte Carlo estimator is unbiased and converges almost surely by the same argument as in the proof of Proposition 1, applied twice: at each fixed the inner average over is bounded with every draw contributing a vertex of the simplex, so the inner running average is itself a bounded, unbiased estimate of for every ; averaging these in turn over is again a running average of a bounded quantity, hence unbiased and almost-surely convergent to equation 17 by the same law-of-large-numbers argument one level up.
Consistency (specialisation). Fix any realisation of . Setting gives a.s. by the same joint-posterior-on-the-diagonal argument as Corollary 1's proof, hence for every ; taking gives , so the interval in the numerator of equation 16 contains and the ratio in equation 16 equals 1, while for the intervals and are disjoint (the 's partition the real line the same way the factual class's own interval does). Hence returns the point mass at for every realisation of , and equation 17 inherits this since it is a convex combination, over both and the inner posterior draws, of point masses at .
Corollary 3. If , then and maximise and (degenerately) characterise the posterior equation 53 exactly, so every draw in equation 17: the outer expectation over collapses to evaluation at the single point , and the nested estimator of the Action-and-prediction paragraph above reduces to a single Laplace fit of at the fixed cutpoints followed by the ordinary Monte Carlo average over – exactly Chu and Ghahramani's construction [Chu and Ghahramani, 2005], used throughout this paper prior to this section.
Remark 6 (Why this is not the multiclass Laplace approximation of §A.6.1, restricted to two classes). The ordinal likelihood at reduces to a single cutpoint and coincides with a probit link on , not with the logistic (sigmoid) link of Corollary 2. The two links are close in shape but not identical [MacKay, 1992, Bishop, 2006], so the ordinal-GP estimator is a distinct (probit) binary classifier from the project's default (logistic) GPC, even though both couple a single latent to a single scalar noise. Nothing in the counterfactual argument above depends on which of the two links is used; only the per-point derivatives of Lemma 5 would change.