Introduction
Incorporating causality into Machine Learning can be a crucial step towards developing realistic and explainable models. Pearl et al. [ [18 ] 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 [20 , 5 ] (Zhang et al. 2011). 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 [7 ] . 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.
Counterfactuals
We define counterfactuals and their evaluation as in Pearl et al. [2016]:
Counterfactual Queries
Given observation x F \mathbf{x}^{F} x F , what would have happened if X I X_I X I had instead taken the value θ \theta θ ? The counterfactual variable is written x C F = x ( do ( X I = θ ) ) ∣ x F \mathbf{x}^{\mathrm{CF}} = \mathbf{x}(\operatorname{do}(X_I = \theta)) \mid\mathbf{x}^{F} x CF = x ( do ( X I = θ )) ∣ x F .
Given a fully specified SCM M M M with d d d nodes and equations F = { X r : = f r ( X pa ( r ) , U r ) } r = 1 d \mathbf{F} = \{\mathbf{X}_r := f_r(\mathbf{X}_{\operatorname{pa}(r)}, U_r)\}_{r=1}^{d} F = { X r := f r ( X pa ( r ) , U r ) } r = 1 d , and an observed instance x F \mathbf{x}^{F} x F , counterfactuals asking what would have happened had we set X I = θ X_I = \theta X I = θ are evaluated using the following three steps:
Three Steps for Computing Counterfactuals
Abduction: Use evidence x F \mathbf{x}^{F} x F and the equations to solve backwards for { U r } r = 1 d \{U_r\}_{r=1}^{d} { U r } r = 1 d .
Action: Modify the model M M M , by performing the intervention do ( X I = θ ) \operatorname{do}(X_I = \theta) do ( X I = θ ) , to get new structural equations F do ( X I = θ ) \mathbf{F}^{\operatorname{do}(X_I=\theta)} F do ( X I = θ ) .
Prediction: Use the modified structural equations and the values of { U r } r = 1 d \{U_r\}_{r=1}^{d} { U r } r = 1 d to compute the value of x C F \mathbf{x}^{\mathrm{CF}} x CF .
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].
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 [14 ] , 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 [13 , 2 ] , with Chu and Ghahramani [2005] giving the Gaussian Process likelihood our construction builds on; deep generative alternatives dequantise discrete variables into normalising-flow SCMs [16 ] , or relax categorical latents via a temperature-annealed softmax [6 , 12 ] 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.
Preliminaries
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 [6 , 12 ] . We instead exploit its exact (non-relaxed) form to obtain closed-form noise abduction.
Gumbel Distribution [4 ] . G ∼ Gumbel ( μ , 1 ) G \sim\operatorname{Gumbel}(\mu,1) G ∼ Gumbel ( μ , 1 ) if it has CDF F ( g ) = exp ( − e − ( g − μ ) ) F(g) = \exp\left(-e^{-(g-\mu)}\right) F ( g ) = exp ( − e − ( g − μ ) ) on R \mathbb{R} R .
We highlight three important properties of this distribution that we will use to evaluate the counterfactuals:
Reparameterisation: V ∼ Uniform ( 0 , 1 ) ⟹ μ − log ( − log V ) ∼ Gumbel ( μ , 1 ) V \sim\operatorname{Uniform}(0,1) \Longrightarrow\mu- \log(-\log V) \sim\operatorname{Gumbel}(\mu,1) V ∼ Uniform ( 0 , 1 ) ⟹ μ − log ( − log V ) ∼ Gumbel ( μ , 1 ) .
Truncation [11 ] : Conditioned on G ≤ b G \le b G ≤ b ,
μ − log ( e − ( b − μ ) − log V ) ∼ Gumbel ( μ , 1 ) \mu- \log\left(e^{-(b-\mu)} - \log V\right) \sim\operatorname{Gumbel}(\mu,1) μ − log ( e − ( b − μ ) − log V ) ∼ Gumbel ( μ , 1 ) for V ∼ Uniform ( 0 , 1 ) V \sim\operatorname{Uniform}(0,1) V ∼ Uniform ( 0 , 1 )
has the conditioned law.
Gumbel-max trick [Yellott, 1977]: For scores ℓ ∈ R C \ell\in\mathbb{R}^{C} ℓ ∈ R C and iid G 1 , … , G C ∼ Gumbel ( 0 , 1 ) G_1,\ldots,G_C \sim\operatorname{Gumbel}(0,1) G 1 , … , G C ∼ Gumbel ( 0 , 1 ) , the perturbed maximum M : = max c { ℓ c + G c } M := \max_c\{\ell_c + G_c\} M := max c { ℓ c + G c } satisfies
M ∼ Gumbel ( log ∑ c e ℓ c , 1 ) independently of argmax c { ℓ c + G c } ∼ softmax ( ℓ ) M \sim\operatorname{Gumbel}\left(\log\sum_c e^{\ell_c},1\right) \quad\text{independently of } \operatorname*{argmax}_c\{\ell_c+G_c\}\sim\operatorname{softmax}(\ell) M ∼ Gumbel ( log c ∑ e ℓ c , 1 ) independently of c argmax { ℓ c + G c } ∼ softmax ( ℓ )
Coupling and Abduction
When the structural equations are approximated by fitted GPs, the uncertainty about f r f_r f r means that the exogenous noise driving X r X_r X r 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. [ [7 ] , 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, p F p^F p F and p C F p^{\mathrm{CF}} p CF , are each pinned down by the fitted model, but they alone do not determine a joint law over the pair ( X r , X r C F ) (X_r, X_r^{\mathrm{CF}}) ( X r , X r CF ) : 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 X r X_r X r with an explicit exogenous noise variable, infer its posterior from the factual observation x r F x_r^F x r F , and reuse that same noise, unchanged, to generate X r C F X_r^{\mathrm{CF}} X r CF 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 U r ∼ Uniform ( 0 , 1 ) U_r \sim\operatorname{Uniform}(0,1) U r ∼ Uniform ( 0 , 1 ) , 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 P ( X r = 1 ) P(X_r=1) P ( X r = 1 ) .
Categorical. For C ≥ 3 C \ge3 C ≥ 3 unordered classes, one natural noise is a vector of C C 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 [15 ] .
Ordinal. When the classes carry an order, a different noise construction is more natural: a single shared Gaussian N r N_r N r , 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 C = 2 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.
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.
Categorical
Proposition 1 (Categorical Probabilistic Counterfactuals with Gaussian Processes). Let f ( x ) \mathbf{f}(\mathbf{x}) f ( x ) denote a realisation of the fitted GP latent at X p a ( r ) = x \mathbf{X}_{\mathrm{pa}(r)} = \mathbf{x} X pa ( r ) = x , and let p ( x ; f ) : = ( p 1 ( x ; f ) , … , p C ( x ; f ) ) \mathbf{p}(\mathbf{x};\mathbf{f}) := (p_1(\mathbf{x};\mathbf{f}),\ldots,p_C(\mathbf{x};\mathbf{f})) p ( x ; f ) := ( p 1 ( x ; f ) , … , p C ( x ; f )) be the normalised class-probability vector it induces. We fit C C C independent binary Laplace GP classifiers, one per class, and renormalise: p c : = σ ( f c ) / ∑ c ′ σ ( f c ′ ) p_c := \sigma(f_c)/\sum_{c'} \sigma(f_{c'}) p c := σ ( f c ) / ∑ c ′ σ ( f c ′ ) . The joint multiclass softmax fit, under which p = softmax ( f ) \mathbf{p} = \operatorname{softmax}(\mathbf{f}) p = softmax ( f ) 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 log p \log\mathbf{p} log p rather than on f \mathbf{f} f . Write ℓ ( x ) : = log p ( x ; f ) \boldsymbol{\ell}(\mathbf{x}) := \log\mathbf{p}(\mathbf{x};\mathbf{f}) ℓ ( x ) := log p ( x ; f ) for the corresponding log-probability scores, suppressing f \mathbf{f} f where no ambiguity arises. Model the structural equations as:
X r : = arg max c ∈ { 1 , … , C } { ℓ c ( X p a ( r ) ) + G r , c } , G r , c ∼ i i d Gumbel ( 0 , 1 ) , (1) X_r := \underset{c \in\{1,\ldots,C\}}{\arg\max}\{\ell_c(X_{\mathrm{pa}(r)}) + G_{r,c}\}, \qquad G_{r,c} \overset{\mathrm{iid}}{\sim} \operatorname{Gumbel}(0,1), \tag*{(1)} X r := c ∈ { 1 , … , C } arg max { ℓ c ( X pa ( r ) ) + G r , c } , G r , c ∼ iid Gumbel ( 0 , 1 ) , (1) with G r : = ( G r , 1 , … , G r , C ) \mathbf{G}_r := (G_{r,1},\ldots,G_{r,C}) G r := ( G r , 1 , … , G r , C ) .
(Compatibility.) For every x \mathbf{x} x and every realisation of the latent,
P ( X r = c ∣ X p a ( r ) = x , f ) = softmax ( log p ( x ; f ) ) c = p c ( x ; f ) , (2) P(X_r = c \mid X_{\mathrm{pa}(r)} = \mathbf{x},\mathbf{f}) = \operatorname{softmax}(\log\mathbf{p}(\mathbf{x};\mathbf{f}))_c = p_c(\mathbf{x};\mathbf{f}), \tag*{(2)} P ( X r = c ∣ X pa ( r ) = x , f ) = softmax ( log p ( x ; f ) ) c = p c ( x ; f ) , (2) the softmax identity required by the schema above.
(Abduction.) Write ℓ F : = ℓ ( x p a ( r ) F ; f F ) \boldsymbol{\ell}^{F} := \boldsymbol{\ell}(\mathbf{x}^{F}_{\mathrm{pa}(r)};\mathbf{f}^{F}) ℓ F := ℓ ( x pa ( r ) F ; f F ) and let c ∗ : = x r F c^* := x_r^{F} c ∗ := x r F be the observed class, and M : = max c { ℓ c F + G r , c } M := \max_{c}\{\ell_c^{F} + G_{r,c}\} M := max c { ℓ c F + G r , c } is the factual winning score. Conditional on ℓ F \boldsymbol{\ell}^{F} ℓ F and on X r = c ∗ X_r = c^* X r = c ∗ , the posterior of G r \mathbf{G}_r G r is sampled exactly by
M ∼ Gumbel ( log ∑ c e ℓ c F , 1 ) , G r , c ∗ : = M − ℓ c ∗ F , G r , c : = − log ( e − ( M − ℓ c F ) − log V c ) , c ≠ c ∗ , (3) M \sim\operatorname{Gumbel}\left(\log\sum_c e^{\ell_c^{F}},1\right), \qquad G_{r,c^*} := M-\ell_{c^*}^{F}, \qquad G_{r,c} := -\log(e^{-(M-\ell_c^{F})}-\log V_c),\ c \ne c^*, \tag*{(3)} M ∼ Gumbel ( log c ∑ e ℓ c F , 1 ) , G r , c ∗ := M − ℓ c ∗ F , G r , c := − log ( e − ( M − ℓ c F ) − log V c ) , c = c ∗ , (3) with V c ∼ i i d Uniform ( 0 , 1 ) V_c \overset{\mathrm{iid}}{\sim} \operatorname{Uniform}(0,1) V c ∼ iid Uniform ( 0 , 1 ) .
(Action and Prediction.) The intervention replaces x p a ( r ) F \mathbf{x}^{F}_{\mathrm{pa}(r)} x pa ( r ) F by x ~ p a ( r ) \tilde{\mathbf{x}}_{\mathrm{pa}(r)} x ~ pa ( r ) leaving the latent process and G r \mathbf{G}_r G r fixed, so with ℓ ~ : = ℓ ( x ~ p a ( r ) ) \tilde{\boldsymbol{\ell}} := \boldsymbol{\ell}(\tilde{\mathbf{x}}_{\mathrm{pa}(r)}) ℓ ~ := ℓ ( x ~ pa ( r ) ) ,
X r C F = arg max c { ℓ ~ c + G r , c } . (4) X_r^{\mathrm{CF}} = \underset{c}{\arg\max}\{\tilde{\ell}_c + G_{r,c}\}. \tag*{(4)} X r CF = c arg max { ℓ ~ c + G r , c } . (4)
As the schema requires, ( f F , f ~ ) (\mathbf{f}^{F},\tilde{\mathbf{f}}) ( f F , f ~ ) , from which ℓ F \ell^{F} ℓ F and ℓ ~ \tilde{\ell} ℓ ~ are formed, are drawn from their joint posterior, which for each class c c c is the bivariate Gaussian with means k F ( e r , c − π ^ r , c ) \mathbf{k}_{F}(\mathbf{e}_{r,c}-\hat{\boldsymbol{\pi}}_{r,c}) k F ( e r , c − π ^ r , c ) and k ~ ⊤ ( e r , c − π ^ r , c ) \tilde{\mathbf{k}}^{\top}(\mathbf{e}_{r,c}-\hat{\boldsymbol{\pi}}_{r,c}) k ~ ⊤ ( e r , c − π ^ r , c ) and covariance
Cov ( f c F , f ~ c ) = k r ( x pa ( r ) F , x ~ pa ( r ) ) − k F ⊤ ( K + W ^ c − 1 ) − 1 k ~ , k F : = ( k r ( x pa ( r ) F , x pa ( r ) i ) ) i = 1 n . (5) \operatorname{Cov}(f_{c}^{F},\tilde{f}_{c})=k_{r}\left(\mathbf{x}_{\operatorname{pa}(r)}^{F},\tilde{\mathbf{x}}_{\operatorname{pa}(r)}\right)-\mathbf{k}_{F}^{\top}\left(\mathbf{K}+\hat{\mathbf{W}}_{c}^{-1}\right)^{-1}\tilde{\mathbf{k}},\qquad\mathbf{k}_{F}:=\left(k_{r}\left(\mathbf{x}_{\operatorname{pa}(r)}^{F},\mathbf{x}_{\operatorname{pa}(r)}^{i}\right)\right)_{i=1}^{n}. \tag*{(5)} Cov ( f c F , f ~ c ) = k r ( x pa ( r ) F , x ~ pa ( r ) ) − k F ⊤ ( K + W ^ c − 1 ) − 1 k ~ , k F := ( k r ( x pa ( r ) F , x pa ( r ) i ) ) i = 1 n . (5)
Under the one-versus-rest fit the C C C classifiers are independent, so the pairs ( f c F , f ~ c ) (f_{c}^{F},\tilde{f}_{c}) ( f c F , f ~ c ) are drawn independently across classes. Within a class, however, the pair must be a single draw from equation (5) : f r , c f_{r,c} f r , c 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
P ( X r C F = c ∣ x F ) = E ( f F , f ~ ) E G r ∣ x F , f F [ I { arg max c ′ ( ℓ ~ c ′ + G r , c ′ ) = c } ] . (6) P\left(X_{r}^{\mathrm{CF}}=c\mid\mathbf{x}^{F}\right)=\mathbb{E}_{(f^{F},\tilde{f})}\mathbb{E}_{G_{r}\mid\mathbf{x}^{F},f^{F}}\left[\mathbb{I}\left\{\underset{c'}{\arg\max}\left(\tilde{\ell}_{c'}+G_{r,c'}\right)=c\right\}\right]. \tag*{(6)} P ( X r CF = c ∣ x F ) = E ( f F , f ~ ) E G r ∣ x F , f F [ I { c ′ arg max ( ℓ ~ c ′ + G r , c ′ ) = c } ] . (6)
approximated by Monte Carlo over draws of ( f F , f ~ ) (\mathbf{f}^{F},\tilde{\mathbf{f}}) ( f F , f ~ ) and, for each, a draw of G r \mathbf{G}_{r} G r from equation (3) .
Corollary 1 (Consistency under the trivial intervention). In the setting of Proposition 1, intervening at the factual parent value itself, do ( X pa ( r ) = x pa ( r ) F ) \operatorname{do}(\mathbf{X}_{\operatorname{pa}(r)}=\mathbf{x}_{\operatorname{pa}(r)}^{F}) do ( X pa ( r ) = x pa ( r ) F ) , recovers the observed factual outcome with certainty:
P ( X r C F = x r F ∣ x F , do ( X pa ( r ) = x pa ( r ) F ) ) = 1. (7) P\left(X_{r}^{\mathrm{CF}}=x_{r}^{F}\mid\mathbf{x}^{F},\operatorname{do}\left(\mathbf{X}_{\operatorname{pa}(r)}=\mathbf{x}_{\operatorname{pa}(r)}^{F}\right)\right)=1. \tag*{(7)} P ( X r CF = x r F ∣ x F , do ( X pa ( r ) = x pa ( r ) F ) ) = 1. (7)
Corollary 2 (Binary case: closed form). Let C = 2 C=2 C = 2 and put p ( x ) : = p 1 ( x ) = σ ( f r ( x ) ) p(\mathbf{x}):=p_{1}(\mathbf{x})=\sigma(f_{r}(\mathbf{x})) p ( x ) := p 1 ( x ) = σ ( f r ( x )) with σ ( t ) = ( 1 + e − t ) − 1 \sigma(t)=(1+e^{-t})^{-1} σ ( t ) = ( 1 + e − t ) − 1 . Then equation (1) is equivalent to
X r : = I [ p ( X pa ( r ) ) > U r ] , U r ∼ Uniform ( 0 , 1 ) , (8) X_{r}:=\mathbb{I}\left[p(\mathbf{X}_{\operatorname{pa}(r)})>U_{r}\right],\qquad U_{r}\sim\operatorname{Uniform}(0,1), \tag*{(8)} X r := I [ p ( X pa ( r ) ) > U r ] , U r ∼ Uniform ( 0 , 1 ) , (8) the exogenous noise being U r = σ ( G r , 2 − G r , 1 ) U_{r}=\sigma(G_{r,2}-G_{r,1}) U r = σ ( G r , 2 − G r , 1 ) .
Abduction is exact: writing p F : = p ( x pa ( r ) F ) p^{F}:=p(\mathbf{x}_{\operatorname{pa}(r)}^{F}) p F := p ( x pa ( r ) F ) ,
U r ∣ x F , f r ∼ { Uniform ( 0 , p F ) , x r F = 1 , Uniform ( p F , 1 ) , x r F = 0 , (9) U_{r}\mid\mathbf{x}^{F},f_{r}\sim
\begin{cases}
\operatorname{Uniform}(0,p^{F}), & x_{r}^{F}=1,\\
\operatorname{Uniform}(p^{F},1), & x_{r}^{F}=0,
\end{cases} \tag*{(9)} U r ∣ x F , f r ∼ { Uniform ( 0 , p F ) , Uniform ( p F , 1 ) , x r F = 1 , x r F = 0 , (9) and with p C F : = p ( x ~ pa ( r ) ) p^{\mathrm{CF}}:=p(\tilde{\mathbf{x}}_{\operatorname{pa}(r)}) p CF := p ( x ~ pa ( r ) ) ,
P ( X r C F = 1 ∣ x F , f r ) = { min ( p C F , p F ) / p F , x r F = 1 , max ( 0 , p C F − p F ) / ( 1 − p F ) , x r F = 0. (10) P\left(X_{r}^{\mathrm{CF}}=1\mid\mathbf{x}^{F},f_{r}\right)=
\begin{cases}
\min(p^{\mathrm{CF}},p^{F})/p^{F}, & x_{r}^{F}=1,\\
\max(0,p^{\mathrm{CF}}-p^{F})/(1-p^{F}), & x_{r}^{F}=0.
\end{cases} \tag*{(10)} P ( X r CF = 1 ∣ x F , f r ) = { min ( p CF , p F ) / p F , max ( 0 , p CF − p F ) / ( 1 − p F ) , x r F = 1 , x r F = 0. (10) Marginalising over the joint Laplace posterior of ( f F , f ~ ) : = ( f r ( x pa ( r ) F ) , f r ( x ~ pa ( r ) ) ) (f^{F},\tilde{f}):=(f_{r}(\mathbf{x}_{\operatorname{pa}(r)}^{F}),f_{r}(\tilde{\mathbf{x}}_{\operatorname{pa}(r)})) ( f F , f ~ ) := ( f r ( x pa ( r ) F ) , f r ( x ~ pa ( r ) )) gives
P ( X r C F = 1 ∣ x F ) = E ( f F , f ~ ) [ equation 10 evaluated at p F = σ ( f F ) , p C F = σ ( f ~ ) ] . (11) P\left(X_{r}^{\mathrm{CF}}=1\mid\mathbf{x}^{F}\right)=\mathbb{E}_{(f^{F},\tilde{f})}\left[\text{equation 10 evaluated at }p^{F}=\sigma(f^{F}),\ p^{\mathrm{CF}}=\sigma(\tilde{f})\right]. \tag*{(11)} P ( X r CF = 1 ∣ x F ) = E ( f F , f ~ ) [ equation 10 evaluated at p F = σ ( f F ) , p CF = σ ( f ~ ) ] . (11)
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 [3 ] . This is exactly the continuous ANM-GP approach of Karimi et al. [ [7 ] , 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 f r f_{r} f r itself. Write θ = ( θ 1 , … , θ C − 1 ) ∈ R C − 1 \boldsymbol{\theta}=(\theta_{1},\ldots,\theta_{C-1})\in\mathbb{R}^{C-1} θ = ( θ 1 , … , θ C − 1 ) ∈ R C − 1 for an unconstrained parameterisation of the cutpoints,
b 1 ( θ ) : = θ 1 , b c ( θ ) : = b c − 1 ( θ ) + e θ c ( c = 2 , … , C − 1 ) , (12) b_{1}(\boldsymbol{\theta}):=\theta_{1},\qquad b_{c}(\boldsymbol{\theta}):=b_{c-1}(\boldsymbol{\theta})+e^{\theta_{c}}\quad(c=2,\ldots,C-1), \tag*{(12)} b 1 ( θ ) := θ 1 , b c ( θ ) := b c − 1 ( θ ) + e θ c ( c = 2 , … , C − 1 ) , (12)
under which every θ ∈ R C − 1 \boldsymbol{\theta}\in\mathbb{R}^{C-1} θ ∈ R C − 1 maps to a strictly increasing tuple of cutpoints and every strictly increasing tuple arises this way, and place an independent Gaussian prior θ ∼ p ( θ ) : = ∏ c N ( θ c ; 0 , τ c 2 ) \boldsymbol{\theta}\sim p(\boldsymbol{\theta}):=\prod_{c}\mathcal{N}(\theta_{c};0,\tau_{c}^{2}) θ ∼ p ( θ ) := ∏ c N ( θ c ; 0 , τ c 2 ) , a priori independent of f r f_{r} f r and of N r N_{r} N r .
Proposition 2 (Ordinal Probabilistic Counterfactuals with Gaussian Processes and Learned Cutpoints). Model the structural equation as
Y r : = f r ( X p a ( r ) ) + N r , f r ∼ G P ( 0 , k r ) , N r ∼ N ( 0 , 1 ) , θ ∼ p ( θ ) , X r : = ∑ c = 1 C c ⋅ I { b c − 1 ( θ ) ≤ Y r < b c ( θ ) } , (13) \begin{aligned}
Y_r &:= f_r(\mathbf{X}_{\mathrm{pa}(r)}) + N_r,\quad f_r \sim\mathcal{GP}(0,k_r),\quad N_r \sim\mathcal{N}(0,1),\quad\theta\sim p(\theta),\\
X_r &:= \sum_{c=1}^{C} c\cdot\mathbb{I}\{b_{c-1}(\theta) \le Y_r < b_c(\theta)\}, \tag*{(13)}
\end{aligned} Y r X r := f r ( X pa ( r ) ) + N r , f r ∼ G P ( 0 , k r ) , N r ∼ N ( 0 , 1 ) , θ ∼ p ( θ ) , := c = 1 ∑ C c ⋅ I { b c − 1 ( θ ) ≤ Y r < b c ( θ )} , (13) with b 0 ( θ ) : = − ∞ b_0(\theta):=-\infty b 0 ( θ ) := − ∞ , b C ( θ ) : = ∞ b_C(\theta):=\infty b C ( θ ) := ∞ , and ( f r , N r , θ ) (f_r,N_r,\theta) ( f r , N r , θ ) mutually independent a priori.
(Compatibility.) Recall that for N ∼ N ( 0 , 1 ) N \sim\mathcal{N}(0,1) N ∼ N ( 0 , 1 ) we have the CDF: Φ ( z ) = P ( N ≤ z ) \Phi(z)=P(N\le z) Φ ( z ) = P ( N ≤ z ) . For every x \mathbf{x} x and every realisation of ( f r , θ ) (f_r,\theta) ( f r , θ ) ,
P ( X r = c ∣ X p a ( r ) = x , f r , θ ) = Φ ( b c ( θ ) − f r ( x ) ) − Φ ( b c − 1 ( θ ) − f r ( x ) ) , (14) P(X_r=c\mid\mathbf{X}_{\mathrm{pa}(r)}=\mathbf{x},f_r,\theta)=\Phi(b_c(\theta)-f_r(\mathbf{x}))-\Phi(b_{c-1}(\theta)-f_r(\mathbf{x})), \tag*{(14)} P ( X r = c ∣ X pa ( r ) = x , f r , θ ) = Φ ( b c ( θ ) − f r ( x )) − Φ ( b c − 1 ( θ ) − f r ( x )) , (14) the identity required by the schema above; nothing in it uses θ \theta θ 's non-randomness.
(Abduction.) Let c ∗ : = x r F c^*:=x_r^F c ∗ := x r F and, for any realisation of θ \theta θ , write ( a F ( θ ) , b F ( θ ) ) : = ( b c ∗ − 1 ( θ ) , b c ∗ ( θ ) ) (a^F(\theta),b^F(\theta)):=(b_{c^*-1}(\theta),b_{c^*}(\theta)) ( a F ( θ ) , b F ( θ )) := ( b c ∗ − 1 ( θ ) , b c ∗ ( θ )) for the interval implied by the observed class, and f r F : = f r ( x p a ( r ) F ) f_r^F:=f_r(\mathbf{x}_{\mathrm{pa}(r)}^F) f r F := f r ( x pa ( r ) F ) . Conditional on θ \theta θ , on f r F f_r^F f r F , and on X r = c ∗ X_r=c^* X r = c ∗ , the posterior of N r N_r N r is exact:
N r ∣ x F , f r F , θ , X r = c ∗ ∼ N ( 0 , 1 ) truncated to ( a F ( θ ) − f r F , b F ( θ ) − f r F ) , (15) N_r\mid\mathbf{x}^F,f_r^F,\theta,X_r=c^* \sim\mathcal{N}(0,1)\text{ truncated to }(a^F(\theta)-f_r^F,b^F(\theta)-f_r^F), \tag*{(15)} N r ∣ x F , f r F , θ , X r = c ∗ ∼ N ( 0 , 1 ) truncated to ( a F ( θ ) − f r F , b F ( θ ) − f r F ) , (15) by exactly the fixed-cutpoint argument, since θ \theta θ enters only through which interval is being conditioned on. Marginalising over the joint posterior of ( f r F , θ ) (f_r^F,\theta) ( f r F , θ ) , the noise's posterior is the continuous mixture of truncated normals obtained by averaging equation (15) over $\theta.
(Action and Prediction.) The intervention replaces x p a ( r ) F \mathbf{x}_{\mathrm{pa}(r)}^F x pa ( r ) F by x ~ p a ( r ) \widetilde{\mathbf{x}}_{\mathrm{pa}(r)} x pa ( r ) , leaving the latent process, θ \theta θ , and N r N_r N r fixed, so with f ~ r : = f r ( x ~ p a ( r ) ) \widetilde{f}_r:=f_r(\widetilde{\mathbf{x}}_{\mathrm{pa}(r)}) f r := f r ( x pa ( r ) ) ,
P ( X r C F = k ∣ x F , f r F , f ~ r , θ ) = [ Φ ( min ( β , γ k ) ) − Φ ( max ( α , γ k − 1 ) ) ] + Φ ( β ) − Φ ( α ) , (16) P(X_r^{\mathrm{CF}}=k\mid\mathbf{x}^F,f_r^F,\widetilde{f}_r,\theta)=\frac{\left[\Phi(\min(\beta,\gamma_k))-\Phi(\max(\alpha,\gamma_{k-1}))\right]_+}{\Phi(\beta)-\Phi(\alpha)}, \tag*{(16)} P ( X r CF = k ∣ x F , f r F , f r , θ ) = Φ ( β ) − Φ ( α ) [ Φ ( min ( β , γ k )) − Φ ( max ( α , γ k − 1 )) ] + , (16) where α : = a F ( θ ) − f r F \alpha:=a^F(\theta)-f_r^F α := a F ( θ ) − f r F , β : = b F ( θ ) − f r F \beta:=b^F(\theta)-f_r^F β := b F ( θ ) − f r F , γ k : = b k ( θ ) − f ~ r \gamma_k:=b_k(\theta)-\widetilde{f}_r γ k := b k ( θ ) − f r and ( ⋅ ) + : = max ( 0 , ⋅ ) (\cdot)_+:=\max(0,\cdot) ( ⋅ ) + := max ( 0 , ⋅ ) . Since f r f_r f r is unknown, ( f r F , f ~ r ) (f_r^F,\widetilde{f}_r) ( f r F , f r ) must be drawn from their joint posterior given θ \theta θ , approximated as Gaussian by the Laplace approximation to the ordinal likelihood equation (14) [[3 ] ], the single-latent analogue of the joint Laplace posterior in eq. (5) , and θ \theta θ is itself unknown, drawn from its own Laplace-Gaussian posterior (Lemma 6). The full estimator therefore marginalises over both:
P ( X r C F = k ∣ x F ) = E θ [ E ( f r F , f ~ r ) ∣ θ [ equation 16 ] ] , (17) P(X_r^{\mathrm{CF}}=k\mid\mathbf{x}^F)=\mathbb{E}_{\theta}\left[\mathbb{E}_{(f_r^F,\widetilde{f}_r)\mid\theta}\left[\text{equation 16}\right]\right], \tag*{(17)} P ( X r CF = k ∣ x F ) = E θ [ E ( f r F , f r ) ∣ θ [ equation 16 ] ] , (17) approximated by nested Monte Carlo: draw θ ( s ) \theta^{(s)} θ ( s ) from its Laplace-Gaussian posterior, refit the single-latent joint posterior of ( f r F , f ~ r ) (f_r^F,\widetilde{f}_r) ( f r F , f r ) at the resulting cutpoints b ( θ ( s ) ) \mathbf{b}(\theta^{(s)}) b ( θ ( s ) ) , draw from it, and average equation (16) over both layers.
Corollary 3 (Fixed cutpoints). When the cutpoints b = b ( θ 0 ) \mathbf{b}=\mathbf{b}(\theta_0) b = b ( θ 0 ) are known rather than inferred, this means p ( θ ) = δ θ 0 p(\theta)=\delta_{\theta_0} p ( θ ) = δ θ 0 is a point mass and the outer expectation in equation (17) collapses to a single term at θ = θ 0 \theta=\theta_0 θ = θ 0 . Then Proposition 2 reduces exactly to fitting a single-latent GP-ordinal model at the given, fixed b \mathbf{b} b : this is the case used throughout Chu and Ghahramani's original construction [[3 ] ] 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 θ \theta θ and write H ( y ) : = ∑ c c ⋅ I { b c − 1 ( θ ) ≤ y < b c ( θ ) } H^{(y)}:=\sum_{c}c\cdot\mathbb{I}\{b_{c-1}(\theta)\le y<b_c(\theta)\} H ( y ) := ∑ c c ⋅ I { b c − 1 ( θ ) ≤ y < b c ( θ )} , non-decreasing. Equation (13) gives X r = H ( f r F + N r ) X_r=H(f_r^F+N_r) X r = H ( f r F + N r ) , both non-decreasing functions of the same scalar; with U : = Φ ( N r ) U:=\Phi(N_r) U := Φ ( N r ) this realises ( X r , X r C F ) (X_r,X_r^{\mathrm{CF}}) ( X r , X r CF ) as ( F p − 1 ( U ) , F q − 1 ( U ) ) (F_p^{-1}(U),F_q^{-1}(U)) ( F p − 1 ( U ) , F q − 1 ( U )) for the factual and counterfactual class distributions p , q p,q p , q — the comonotone coupling (matching the monotonicity assumption used for identification in the binary [[17 ] ] and categorical [[9 ] ] settings).
At C = 2 C = 2 C = 2 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 C = 2 C = 2 C = 2 as couplings, not as fitted models, and they diverge for C ≥ 3 C \ge3 C ≥ 3 (the Experiments section measures the cost). The identification above also holds only at a fixed θ \theta θ : after marginalising over the joint posterior of ( f r F , f ~ r , θ ) (f_r^F, \tilde f_r, \theta) ( f r F , f ~ r , θ ) in equation (17) , the estimator is a mixture of comonotone couplings over varying marginals, which need not itself be comonotone.
Experiments
Setup
Two fully worked examples in Appendix § 7 .§ 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.
Figure 1. The four synthetic SCM structures used in § 4 (Binary, Single-parent, Interaction and Chain), increasing in graph complexity and node type. Node fill color indicates each variable’s data type.
These four structures can naturally occur in many systems, for example in the loan scenario (§ 1 ). 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 n = 500 n = 500 n = 500 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 [ 0.1 σ ^ d , 10 σ ^ d ] [0.1\hat{\sigma}_d, 10\hat{\sigma}_d] [ 0.1 σ ^ d , 10 σ ^ d ] rather than sklearn’s default [ 10 − 5 , 10 5 ] [10^{-5}, 10^5] [ 1 0 − 5 , 1 0 5 ] , 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 (P ≈ 0.20 P \approx0.20 P ≈ 0.20 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 b 1 = − 0.5 b_1 = -0.5 b 1 = − 0.5 , b 2 = 0.5 b_2 = 0.5 b 2 = 0.5 . Ground truth is closed form: since the true score g g g and ( b 1 , b 2 ) (b_1,b_2) ( b 1 , b 2 ) are both known, eq. equation 16 is evaluated directly at f r F = g ( X p a ( r ) F ) f_r^F = g(X_{\mathrm{pa}(r)}^F) f r F = g ( X pa ( r ) F ) , f ~ r = g ( X p a ( r ) ) \tilde f_r = g(X_{\mathrm{pa}(r)}) f ~ r = g ( X pa ( r ) ) , with no Monte Carlo needed. Both fitted estimators below instead learn g g g 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).
X 1 : = U 1 , U 1 ∼ N ( 0 , 1 ) , X 2 : = I [ 2 X 1 + U 2 > 0 ] , : = U 2 ∼ N ( 0 , 1 ) . \begin{aligned}
X_1 &:= U_1,\quad U_1 \sim\mathcal{N}(0,1),\\
X_2 &:= \mathbb{I}[2X_1+U_2>0],\\
&\phantom{:=}\quad U_2 \sim\mathcal{N}(0,1).
\end{aligned} X 1 X 2 := U 1 , U 1 ∼ N ( 0 , 1 ) , := I [ 2 X 1 + U 2 > 0 ] , := U 2 ∼ N ( 0 , 1 ) .
X 1 : = U 1 , U 1 ∼ N ( 0 , 1 ) , X 2 : = arg max c ∈ { 1 , 2 , 3 } { η c ( X 1 ) + G c } , : = η ( x 1 ) = ( 0 , 1.2 x 1 , − x 1 + 0.4 ) . \begin{aligned}
X_1 &:= U_1,\quad U_1 \sim\mathcal{N}(0,1),\\
X_2 &:= \operatorname*{arg\,max}_{c\in\{1,2,3\}}\{\eta_c(X_1)+G_c\},\\
&\phantom{:=}\quad\eta(x_1)=(0,1.2x_1,-x_1+0.4).
\end{aligned} X 1 X 2 := U 1 , U 1 ∼ N ( 0 , 1 ) , := c ∈ { 1 , 2 , 3 } arg max { η c ( X 1 ) + G c } , := η ( x 1 ) = ( 0 , 1.2 x 1 , − x 1 + 0.4 ) .
X 1 , X 2 ∼ N ( 0 , 1 ) i i d , Y 3 : = X 1 X 2 + N 3 , : = N 3 ∼ N ( 0 , 1 ) , X 3 : = 1 + I [ Y 3 > b 1 ] : = + I [ Y 3 > b 2 ] . \begin{aligned}
X_1,X_2 &\sim\mathcal{N}(0,1)\ \mathrm{iid},\\
Y_3 &:= X_1X_2+N_3,\\
&\phantom{:=}\quad N_3\sim\mathcal{N}(0,1),\\
X_3 &:= 1+\mathbb{I}[Y_3>b_1]\\
&\phantom{:=}\quad+\mathbb{I}[Y_3>b_2].
\end{aligned} X 1 , X 2 Y 3 X 3 ∼ N ( 0 , 1 ) iid , := X 1 X 2 + N 3 , := N 3 ∼ N ( 0 , 1 ) , := 1 + I [ Y 3 > b 1 ] := + I [ Y 3 > b 2 ] .
Chain (mixed mechanisms).
X 1 : = U 1 , X 2 : = 1 + I { X 1 + N 2 > b 1 } + I { X 1 + N 2 > b 2 } , N 2 ∼ N ( 0 , 1 ) , X 3 : = arg max c { η ~ c ( X 1 , X 2 ) + G 3 , c } , η ~ ( x 1 , x 2 ) = ( 0 , x 1 + ( x 2 − 2 ) , − ( x 1 + ( x 2 − 2 ) ) ) \begin{aligned}
X_1 &:= U_1,\\
X_2 &:= 1+\mathbb{I}\{X_1+N_2>b_1\}+\mathbb{I}\{X_1+N_2>b_2\},\\
N_2 &\sim\mathcal{N}(0,1),\\
X_3 &:= \operatorname*{arg\,max}_{c}\{\tilde{\eta}_c(X_1,X_2)+G_{3,c}\},\\
\tilde{\eta}(x_1,x_2) &= (0,\,x_1+(x_2-2),\,-(x_1+(x_2-2)))
\end{aligned} X 1 X 2 N 2 X 3 η ~ ( x 1 , x 2 ) := U 1 , := 1 + I { X 1 + N 2 > b 1 } + I { X 1 + N 2 > b 2 } , ∼ N ( 0 , 1 ) , := c arg max { η ~ c ( X 1 , X 2 ) + G 3 , c } , = ( 0 , x 1 + ( x 2 − 2 ) , − ( x 1 + ( x 2 − 2 )))
Computing the ground-truth counterfactual for X 3 X_3 X 3 under d o ( X 1 = x ~ 1 ) do(X_1=\tilde{x}_1) d o ( X 1 = x ~ 1 ) chains two different per-node abductions through the mediator X 2 X_2 X 2 : a truncated-normal posterior for X 2 X_2 X 2 ’s noise (eq. equation 15) and a truncated-Gumbel posterior for X 3 X_3 X 3 ’s (eq. equation 3).
For each experiment, we report two total-variation distances representing how well the fitted structural equation matches the true one (T V i n t \mathrm{TV}_{\mathrm{int}} TV int ), and the counterfactual accuracy (T V c f \mathrm{TV}_{\mathrm{cf}} TV cf ). T V i n t \mathrm{TV}_{\mathrm{int}} TV int represents the distance between P ^ ( X r ∣ X p a ( r ) ) \hat{P}(X_r \mid X_{\mathrm{pa}(r)}) P ^ ( X r ∣ X pa ( r ) ) 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 ± \pm ± standard deviation over 10 seeds at n = 500 n = 500 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.
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 T V i n t \mathrm{TV}_{\mathrm{int}} TV int at the same order as the correctly specified rows, while T V c f \mathrm{TV}_{\mathrm{cf}} TV cf 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 T V i n t \mathrm{TV}_{\mathrm{int}} TV int 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 x 1 x 2 x_1x_2 x 1 x 2 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 T V i n t \mathrm{TV}_{\mathrm{int}} TV int itself, by a factor of six on the Single-parent SCM (0.030 → 0.184), 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.
Table 1. Counterfactual error T V c f \mathrm{TV}_{\mathrm{cf}} TV cf and interventional error T V i n t \mathrm{TV}_{\mathrm{int}} TV int across all four synthetic SCMs, under a categorical fit and under an ordinal fit with learned cutpoints; mean ± \pm ± sd over 10 seeds at n = 500 n = 500 n = 500 . Mediator applies only to the Chain SCM’s X 3 X_3 X 3 : whether the upstream mediator X 2 X_2 X 2 was fit as a categorical or ordinal node, isolating propagated error from X 3 X_3 X 3 ’s own.
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 T V c f \mathrm{TV}_{\mathrm{cf}} TV cf , 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 \mathbf{b} b jointly with g g g (Proposition 2’s general construction) instead of being given the true b 1 = − 0.5 b_1=-0.5 b 1 = − 0.5 , b 2 = 0.5 b_2=0.5 b 2 = 0.5 (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, n = 100 n=100 n = 100 to 1000 (Table 2 , Appendix § 7 .§ 4 ), shows T V i n t \mathrm{TV}_{\mathrm{int}} TV int and T V c f \mathrm{TV}_{\mathrm{cf}} TV cf falling together where the coupling is correct, as ordinary GP asymptotics predict, but diverging where it is wrong: T V i n t \mathrm{TV}_{\mathrm{int}} TV int keeps improving while T V c f \mathrm{TV}_{\mathrm{cf}} TV cf flattens onto a floor near 0.21–0.24, so their ratio grows with n n n 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.
Table 2.
Ablating the estimator confirms the coupling, not the GP, is responsible. Table 3 (Appendix § 7 .§ 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.
Table 3. Counterfactual error T V c f \mathrm{TV}_{\mathrm{cf}} TV cf for five estimators on the same data, mean ± \pm ± sd over 10 seeds at n = 500 n = 500 n = 500 . 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.
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. [ [8 ] 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. [ [8 ] 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.
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 § 7 .§ 6 , with assumptions stated alongside each result and the Gaussian process background they build on recalled in Appendix § 7 .§ 1 . All experiments use synthetic SCMs whose generating equations are given explicitly in § 4 and Appendix § 7 .§ 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 § 7 .§ 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.
Appendix
Definitions
Definition 1 (Gaussian Process Prior [19 ] ). 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 m ( x ) m(\mathbf{x}) m ( x ) and covariance function k ( x , x ′ ) k(\mathbf{x},\mathbf{x}') k ( x , x ′ ) , defined as:
m ( x ) = E [ f ( x ) ] , (18) m(\mathbf{x}) = \mathbb{E}[f(\mathbf{x})], \tag*{(18)} m ( x ) = E [ f ( x )] , (18) k ( x , x ′ ) = E [ ( f ( x ) − m ( x ) ) ( f ( x ′ ) − m ( x ′ ) ) ] . (19) k(\mathbf{x},\mathbf{x}') = \mathbb{E}[(f(\mathbf{x})-m(\mathbf{x}))(f(\mathbf{x}')-m(\mathbf{x}'))]. \tag*{(19)} k ( x , x ′ ) = E [( f ( x ) − m ( x )) ( f ( x ′ ) − m ( x ′ ))] . (19) We denote the GP prior over functions as
f ( x ) ∼ G P ( m ( x ) , k ( x , x ′ ) ) . (20) f(\mathbf{x}) \sim\mathcal{GP}(m(\mathbf{x}), k(\mathbf{x},\mathbf{x}')). \tag*{(20)} f ( x ) ∼ G P ( m ( x ) , k ( x , x ′ )) . (20) For notational convenience the mean function is often taken to be zero.
Definition 2 (Gaussian Process Posterior [19 ] ). Let D = { ( x i , y i ) } i = 1 n \mathcal{D} = \{(\mathbf{x}_i,y_i)\}_{i=1}^{n} D = {( x i , y i ) } i = 1 n be training observations with y i = f ( x i ) + ϵ y_i=f(\mathbf{x}_i)+\epsilon y i = f ( x i ) + ϵ , ϵ ∼ N ( 0 , σ n 2 ) \epsilon\sim\mathcal{N}(0,\sigma_n^2) ϵ ∼ N ( 0 , σ n 2 ) , and let f ∼ G P ( 0 , k ( x , x ′ ) ) f\sim\mathcal{GP}(0,k(\mathbf{x},\mathbf{x}')) f ∼ G P ( 0 , k ( x , x ′ )) . The joint prior over training targets y \mathbf{y} y and test function values f ∗ \mathbf{f}_* f ∗ at inputs X ∗ \mathbf{X}_* X ∗ is:
\begin{bmatrix}
\mathbf{y}\\
\mathbf{f}_*
\end{bmatrix}
\sim\mathcal{N}\left(\mathbf{0},
\begin{bmatrix}
K(\mathbf{X},\mathbf{X})+\sigma_n^2 I & K(\mathbf{X},\mathbf{X}_*)\\
K(\mathbf{X}_*,\mathbf{X}) & K(\mathbf{X}_*,\mathbf{X}_*)
\end{bmatrix}\right). \tag*{(21)}\end{bmatrix}
Conditioning on the observations yields the GP posterior predictive distribution:
f ∗ ∣ X , y , X ∗ ∼ N ( f ˉ ∗ , Cov ( f ∗ ) ) , (22) \mathbf{f}_* \mid\mathbf{X},\mathbf{y},\mathbf{X}_* \sim\mathcal{N}(\bar{\mathbf{f}}_*,\operatorname{Cov}(\mathbf{f}_*)), \tag*{(22)} f ∗ ∣ X , y , X ∗ ∼ N ( f ˉ ∗ , Cov ( f ∗ )) , (22) f ˉ ∗ ≜ K ( X ∗ , X ) [ K ( X , X ) + σ n 2 I ] − 1 y , (23) \bar{\mathbf{f}}_* \triangleq K(\mathbf{X}_*,\mathbf{X})[K(\mathbf{X},\mathbf{X})+\sigma_n^2 I]^{-1}\mathbf{y}, \tag*{(23)} f ˉ ∗ ≜ K ( X ∗ , X ) [ K ( X , X ) + σ n 2 I ] − 1 y , (23) Cov ( f ∗ ) = K ( X ∗ , X ∗ ) − K ( X ∗ , X ) [ K ( X , X ) + σ n 2 I ] − 1 K ( X , X ∗ ) . (24) \operatorname{Cov}(\mathbf{f}_*) = K(\mathbf{X}_*,\mathbf{X}_*)-K(\mathbf{X}_*,\mathbf{X})[K(\mathbf{X},\mathbf{X})+\sigma_n^2 I]^{-1}K(\mathbf{X},\mathbf{X}_*). \tag*{(24)} Cov ( f ∗ ) = K ( X ∗ , X ∗ ) − K ( X ∗ , X ) [ K ( X , X ) + σ n 2 I ] − 1 K ( X , X ∗ ) . (24) For a single test point x ∗ \mathbf{x}_* x ∗ with k ∗ ≜ K ( X , x ∗ ) \mathbf{k}_* \triangleq K(\mathbf{X},\mathbf{x}_*) k ∗ ≜ K ( X , x ∗ ) , these reduce to:
f ˉ ∗ = k ∗ T ( K + σ n 2 I ) − 1 y , Var [ f ∗ ] = k ( x ∗ , x ∗ ) − k ∗ T ( K + σ n 2 I ) − 1 k ∗ . (25) \bar{f}_* = \mathbf{k}_*^{\mathsf{T}}(K+\sigma_n^2 I)^{-1}\mathbf{y},\qquad\operatorname{Var}[f_*] = k(\mathbf{x}_*,\mathbf{x}_*)-\mathbf{k}_*^{\mathsf{T}}(K+\sigma_n^2 I)^{-1}\mathbf{k}_*. \tag*{(25)} f ˉ ∗ = k ∗ T ( K + σ n 2 I ) − 1 y , Var [ f ∗ ] = k ( x ∗ , x ∗ ) − k ∗ T ( K + σ n 2 I ) − 1 k ∗ . (25)
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 X r X_r X r with C = 3 C=3 C = 3 classes { 1 , 2 , 3 } \{1,2,3\} { 1 , 2 , 3 } , treating the fitted GP latent as known exactly at the factual and counterfactual parent values (the Compatibility case of Proposition 1), so that ℓ F \ell^{F} ℓ F and ℓ ~ \tilde{\ell} ℓ ~ below are fixed score vectors rather than posterior draws.
Setup. Let X r X_r X r have a single scalar parent, so that x p a ( r ) \mathbf{x}_{\mathrm{pa}(r)} x pa ( r ) is one number, and fix the intervention up front: the factual parent value is x p a ( r ) F = 0.5 \mathbf{x}^{F}_{\mathrm{pa}(r)}=0.5 x pa ( r ) F = 0.5 and we intervene with do ( X p a ( r ) = x ~ p a ( r ) ) \operatorname{do}(X_{\mathrm{pa}(r)}=\tilde{\mathbf{x}}_{\mathrm{pa}(r)}) do ( X pa ( r ) = x ~ pa ( r ) ) at x ~ p a ( r ) = 2.5 \tilde{\mathbf{x}}_{\mathrm{pa}(r)}=2.5 x ~ pa ( r ) = 2.5 . The intervention is on the parent, not on X r X_r X r itself; the class taken by X r X_r X r is what the three steps below compute. Both score vectors are outputs of the already-fitted classifier, read off at these two inputs through ℓ ( x ) = log p ( x ; f ) \ell(\mathbf{x})=\log p(\mathbf{x};\mathbf{f}) ℓ ( x ) = log p ( x ; f ) , and neither is chosen at counterfactual time.
At the factual input the classifier gives p F : = p ( x p a ( r ) F ; f ) = ( 0.7 , 0.2 , 0.1 ) \mathbf{p}^{F} := \mathbf{p}(\mathbf{x}^{F}_{\mathrm{pa}(r)};\mathbf{f}) = (0.7,\,0.2,\,0.1) p F := p ( x pa ( r ) F ; f ) = ( 0.7 , 0.2 , 0.1 ) , so ℓ F = log p F = ( − 0.3567 , − 1.6094 , − 2.3026 ) \boldsymbol{\ell}^{F} = \log\mathbf{p}^{F} = (-0.3567,\,-1.6094,\,-2.3026) ℓ F = log p F = ( − 0.3567 , − 1.6094 , − 2.3026 ) and the observed factual outcome is x r F = c ∗ = 1 x^{F}_{r} = c^{*} = 1 x r F = c ∗ = 1 . At the intervened input it gives p ~ : = p ( x ~ p a ( r ) ; f ) = ( 0.2 , 0.3 , 0.5 ) \tilde{\mathbf{p}} := \mathbf{p}(\tilde{\mathbf{x}}_{\mathrm{pa}(r)};\mathbf{f}) = (0.2,\,0.3,\,0.5) p ~ := p ( x ~ pa ( r ) ; f ) = ( 0.2 , 0.3 , 0.5 ) , i.e. ℓ ~ = ( − 1.6094 , − 1.2040 , − 0.6931 ) \tilde{\boldsymbol{\ell}} = (-1.6094,\,-1.2040,\,-0.6931) ℓ ~ = ( − 1.6094 , − 1.2040 , − 0.6931 ) — moving the parent from 0.5 to 2.5 makes class 3, not class 1, the most probable outcome.
Abduction (eq. equation (3) ). Since p F \mathbf{p}^{F} p F is normalised, μ : = log ∑ c e ℓ c F = 0 \mu:= \log\sum_c e^{\ell_c^F} = 0 μ := log ∑ c e ℓ c F = 0 . Suppose the sampler draws V M = 0.6 V_M = 0.6 V M = 0.6 for the factual winning score M M M :
M = μ − log ( − log V M ) = − log ( − log 0.6 ) = 0.6717. M = \mu- \log(-\log V_M) = -\log(-\log0.6) = 0.6717. M = μ − log ( − log V M ) = − log ( − log 0.6 ) = 0.6717.
This fixes G r , c ∗ = M − ℓ c ∗ F = 0.6717 − ( − 0.3567 ) = 1.0284 G_{r,c^*} = M - \ell_{c^*}^{F} = 0.6717 - (-0.3567) = 1.0284 G r , c ∗ = M − ℓ c ∗ F = 0.6717 − ( − 0.3567 ) = 1.0284 . For the two losing classes, drawing V 2 = 0.5 V_2 = 0.5 V 2 = 0.5 and V 3 = 0.9 V_3 = 0.9 V 3 = 0.9 and writing b c : = M − ℓ c F b_c := M - \ell_c^F b c := M − ℓ c F ,
b 2 = 2.2812 , G r , 2 = − log ( e − b 2 − log V 2 ) = − log ( 0.1022 + 0.6931 ) = 0.2290 , b 3 = 2.9743 , G r , 3 = − log ( e − b 3 − log V 3 ) = − log ( 0.0511 + 0.1054 ) = 1.8551. \begin{aligned}
b_2 &= 2.2812,\qquad G_{r,2} = -\log(e^{-b_2} - \log V_2) = -\log(0.1022 + 0.6931) = 0.2290,\\
b_3 &= 2.9743,\qquad G_{r,3} = -\log(e^{-b_3} - \log V_3) = -\log(0.0511 + 0.1054) = 1.8551.
\end{aligned} b 2 b 3 = 2.2812 , G r , 2 = − log ( e − b 2 − log V 2 ) = − log ( 0.1022 + 0.6931 ) = 0.2290 , = 2.9743 , G r , 3 = − log ( e − b 3 − log V 3 ) = − log ( 0.0511 + 0.1054 ) = 1.8551.
The abducted noise vector is G r = ( 1.0284 , 0.2290 , 1.8551 ) \mathbf{G}_{r} = (1.0284,\,0.2290,\,1.8551) G r = ( 1.0284 , 0.2290 , 1.8551 ) , held fixed for the remaining steps.
Action. The intervention replaces ℓ ( X p a ( r ) ) \ell(\mathbf{X}_{\mathrm{pa}(r)}) ℓ ( X pa ( r ) ) by ℓ ~ \tilde{\ell} ℓ ~ in the structural equation equation (1) , giving the modified equation X r C F : = arg max c { ℓ ~ c + G r , c } X^{\mathrm{CF}}_{r} := \arg\max_c\{\tilde{\ell}_c + G_{r,c}\} X r CF := arg max c { ℓ ~ c + G r , c } with G r \mathbf{G}_{r} G r unchanged.
Prediction (eq. equation (4) ). Adding the fixed noise to the post-intervention scores,
ℓ ~ c + G r , c = ( − 0.5810 , − 0.9750 , 1.1619 ) , c = 1 , 2 , 3 , \tilde{\ell}_c + G_{r,c} = (-0.5810,\,-0.9750,\,1.1619),\qquad c = 1,2,3, ℓ ~ c + G r , c = ( − 0.5810 , − 0.9750 , 1.1619 ) , c = 1 , 2 , 3 ,
so X r C F = 3 X^{\mathrm{CF}}_{r} = 3 X r CF = 3 : 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, do ( X p a ( r ) = x p a ( r ) F ) \operatorname{do}(\mathbf{X}_{\mathrm{pa}(r)} = \mathbf{x}^{F}_{\mathrm{pa}(r)}) do ( X pa ( r ) = x pa ( r ) F ) , replaces ℓ ~ \tilde{\ell} ℓ ~ by ℓ F \ell^{F} ℓ F and recovers X r C F = c ∗ = 1 X^{\mathrm{CF}}_{r} = c^{*} = 1 X r CF = c ∗ = 1 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 ℓ F , ℓ ~ \ell^{F},\tilde{\ell} ℓ F , ℓ ~ 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:
X 1 : = U 1 , U 1 ∼ N ( 0 , 1 ) , X_1 := U_1,\qquad U_1 \sim\mathcal{N}(0,1), X 1 := U 1 , U 1 ∼ N ( 0 , 1 ) ,
X 2 : = arg max c ∈ { 1 , 2 , 3 } { η c ( X 1 ) + G c } , G c ∼ i i d Gumbel ( 0 , 1 ) , X_2 := \arg\max_{c\in\{1,2,3\}}\{\eta_c(X_1) + G_c\},\qquad G_c \mathrel{\overset{\mathrm{iid}}{\sim}} \operatorname{Gumbel}(0,1), X 2 := arg c ∈ { 1 , 2 , 3 } max { η c ( X 1 ) + G c } , G c ∼ iid Gumbel ( 0 , 1 ) ,
with η ( x 1 ) = ( 0 , x 1 , − x 1 ) \eta(x_1) = (0,\,x_1,\,-x_1) η ( x 1 ) = ( 0 , x 1 , − x 1 ) : positive x 1 x_1 x 1 favours class 2, negative x 1 x_1 x 1 favours class 3, and class 1 is a constant baseline.
Pipeline. We draw n = 400 n = 400 n = 400 samples ( x i 1 , x i 2 ) (x_i^1,x_i^2) ( x i 1 , x i 2 ) from this SCM and fit an sklearn GaussianProcessClassifier with an RBF kernel to X 1 → X 2 X_1 \to X_2 X 1 → X 2 . For the factual instance x 1 F = 1.7641 x_1^F = 1.7641 x 1 F = 1.7641 , x 2 F = 2 x_2^F = 2 x 2 F = 2 and the intervention do ( X 1 = − 1.7641 ) \operatorname{do}(X_1 = -1.7641) do ( X 1 = − 1.7641 ) , 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 G \mathbf{G} G from the known η \eta η (the same identity as eq. equation (3) , applied to η \boldsymbol{\eta} η instead of a fitted ℓ \ell ℓ ):
The GP estimate evaluates the counterfactual as:
P ^ ( X 2 C F = c ∣ do ( X 1 = − 1.7641 ) ) = ( 0.0635 , 0.0515 , 0.8850 ) \widehat{P}(X_2^{\mathrm{CF}} = c\mid\operatorname{do}(X_1 = -1.7641)) = (0.0635,\,0.0515,\,\mathbf{0.8850}) P ( X 2 CF = c ∣ do ( X 1 = − 1.7641 )) = ( 0.0635 , 0.0515 , 0.8850 )
While the ground truth is:
P ( X 2 C F = c ∣ do ( X 1 = − 1.7641 ) ) = ( 0.0774 , 0.0293 , 0.8933 ) P(X_2^{\mathrm{CF}} = c\mid\operatorname{do}(X_1 = -1.7641)) = (0.0774,\,0.0293,\,\mathbf{0.8933}) P ( X 2 CF = c ∣ do ( X 1 = − 1.7641 )) = ( 0.0774 , 0.0293 , 0.8933 )
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 d o ( X 1 = x 1 F ) do(X_1 = x_1^F) d o ( X 1 = x 1 F ) places probability 1.0 on class 2, confirming eq. equation 2 holds empirically for the fitted model as well as for the true one.
Experimental Protocol
Each entry in Table 1 is a mean ± \pm ± standard deviation over 10 random seeds at n = 500 n = 500 n = 500 : 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 n m c n_{\mathrm{mc}} n mc from 250 to 16,000 moves T V c f \mathrm{TV}_{\mathrm{cf}} TV cf by only +0.012 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.
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 n n n as ordinary GP asymptotics predict: the Single-parent SCM goes from 0.061 to 0.021 between n = 100 n = 100 n = 100 and n = 1000 n = 1000 n = 1000 , 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 T V i n t \mathrm{TV}_{\mathrm{int}} TV int falls by 61% over that range (0.144 → \to → 0.056) and the Chain SCM’s mismatched mediator by 74% (0.091 → \to → 0.024), but their T V c f \mathrm{TV}_{\mathrm{cf}} TV cf barely moves, 0.254 → \to → 0.207 and 0.279 → \to → 0.243, flattening onto a floor near 0.21–0.24.
The ratio T V c f / T V i n t \mathrm{TV}_{\mathrm{cf}}/\mathrm{TV}_{\mathrm{int}} TV cf / TV int 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 T V c f \mathrm{TV}_{\mathrm{cf}} TV cf 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 n n n .
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 T V c f = 0.295 \mathrm{TV}_{\mathrm{cf}} = 0.295 TV cf = 0.295 on the Single-parent SCM, an order of magnitude worse than the 0.031 0.031 0.031 of the full estimator. Conditioning the latent on the factual outcome without abducting an exogenous noise scarcely helps (0.300 0.300 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 T V c f \mathrm{TV}_{\mathrm{cf}} TV cf unchanged to three decimals on both SCMs (0.031 0.031 0.031 against 0.031 0.031 0.031 , 0.232 0.232 0.232 against 0.231 0.231 0.231 ). We report this as a negative result about our own construction. It does not license dropping the joint draw: the pair ( f c F , f c I ) (f_c^F, f_c^I) ( f c F , f c I ) 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 0.005 ± 0.001 0.005 \pm0.001 0.005 ± 0.001 , 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 0.231 0.231 to 0.205 0.205 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.
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 p ( θ ) p(\theta) p ( θ ) to a point mass at some θ 0 \theta_0 θ 0 (so S θ = 1 S_{\theta}=1 S θ = 1 and θ ( 1 ) = θ 0 \theta^{(1)}=\theta_0 θ ( 1 ) = θ 0 deterministically) recovers the fixed-cutpoint algorithm of Corollary 3 exactly, the Training step reducing to a single Laplace fit at the given b ( θ 0 ) \mathbf{b}(\theta_0) b ( θ 0 ) .
Two implementation details are worth stating, because both are easy to get wrong and neither is visible in the equations. First, the pair ( f c F , f ~ c ) (f_c^F, \tilde{f}_c) ( f c F , f ~ c ) 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 − log ( e − b c − log v c ) -\log(e^{-b_c} - \log v_c) − log ( e − b c − log v c ) : 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 { ( x p a ( r ) i , x r i ) } i = 1 n \{(x_{\mathrm{pa}(r)}^i,x_r^i)\}_{i=1}^n {( x pa ( r ) i , x r i ) } i = 1 n ; factual ( x p a ( r ) F , x r F = c ∗ ) (x_{\mathrm{pa}(r)}^F,x_r^F=c^*) ( x pa ( r ) F , x r F = c ∗ ) ; intervention x ~ p a ( r ) \tilde{x}_{\mathrm{pa}(r)} x ~ pa ( r ) ; draws S S S
Ensure: P ^ ( X r C F = c ∣ x F ) \hat{P}(X_r^{\mathrm{CF}}=c\mid x^F) P ^ ( X r CF = c ∣ x F ) for c = 1 , … , C c=1,\ldots,C c = 1 , … , C
Training
for c = 1 , … , C c=1,\ldots,C c = 1 , … , C do
fit a binary Laplace GP classifier for class c c c against the rest ▷ one-versus-rest; Remark 2
end for
Posterior moments — independent of the draw, so computed once
for c = 1 , … , C c=1,\ldots,C c = 1 , … , C do
( μ c F , s c F 2 , μ ~ c , s ~ c 2 , ρ c ) ← (\mu_c^F,s_c^{F2},\tilde{\mu}_c,\tilde{s}_c^2,\rho_c)\leftarrow ( μ c F , s c F 2 , μ ~ c , s ~ c 2 , ρ c ) ← joint two-point Laplace moments at ( x p a ( r ) F , x ~ p a ( r ) ) (x_{\mathrm{pa}(r)}^F,\tilde{x}_{\mathrm{pa}(r)}) ( x pa ( r ) F , x ~ pa ( r ) ) , eq. equation 5
end for
n ← 0 ∈ R C \mathbf{n}\leftarrow0\in\mathbb{R}^C n ← 0 ∈ R C
for s = 1 , … , S s=1,\ldots,S s = 1 , … , S do ▷ marginalise over the GP posterior
for c = 1 , … , C c=1,\ldots,C c = 1 , … , C do
draw ( f c F , f ~ c ) (f_c^F,\tilde{f}_c) ( f c F , f ~ c ) jointly from the bivariate Gaussian above ▷ one draw, both inputs; classes independent
end for
ℓ F ← log norm ( σ ( f F ) ) , ℓ ~ ← log norm ( σ ( f ~ ) ) \ell^F\leftarrow\log\operatorname{norm}(\sigma(f^F)),\quad\tilde{\ell}\leftarrow\log\operatorname{norm}(\sigma(\tilde{f})) ℓ F ← log norm ( σ ( f F )) , ℓ ~ ← log norm ( σ ( f ~ )) ▷ coupling lives on log p \log\mathbf{p} log p
Abduction — eq. equation 3
V ∼ Uniform ( 0 , 1 ) ; M ← log ∑ c e ℓ c F − log ( − log V ) V\sim\operatorname{Uniform}(0,1);\quad M\leftarrow\log\sum_c e^{\ell_c^F}-\log(-\log V) V ∼ Uniform ( 0 , 1 ) ; M ← log ∑ c e ℓ c F − log ( − log V ) ▷ the factual winning score
b c ← M − ℓ c F ; E c ∼ i i d Exp ( 1 ) b_c\leftarrow M-\ell_c^F;\quad E_c\mathrel{\stackrel{\mathrm{iid}}{\sim}}\operatorname{Exp}(1) b c ← M − ℓ c F ; E c ∼ iid Exp ( 1 )
G c ∗ ← b c ∗ ; G c ← − logaddexp ( − b c , log E c ) G_{c^*}\leftarrow b_{c^*};\quad G_c\leftarrow-\operatorname{logaddexp}(-b_c,\log E_c) G c ∗ ← b c ∗ ; G c ← − logaddexp ( − b c , log E c ) for c ≠ c ∗ c\ne c^* c = c ∗
Action and prediction
k ← arg max c { ℓ ~ c + G c } ; n k ← n k + 1 k\leftarrow\operatorname*{arg\,max}_c\{\tilde{\ell}_c+G_c\};\quad n_k\leftarrow n_k+1 k ← arg max c { ℓ ~ c + G c } ; n k ← n k + 1
end for
return n / S \mathbf{n}/S n / S
Algorithm 2 Counterfactual for an ordinal node with learned cutpoints (Proposition 2)
Require: sample; cutpoint prior p ( θ ) p(\theta) p ( θ ) (eq. equation 12); factual ( x p a ( r ) F , x r F = c ∗ ) (x_{\mathrm{pa}(r)}^F,x_r^F=c^*) ( x pa ( r ) F , x r F = c ∗ ) ; intervention x ~ p a ( r ) \tilde{x}_{\mathrm{pa}(r)} x ~ pa ( r ) ; outer draws S θ S_\theta S θ ; inner draws S f S_f S f
Ensure: P ^ ( X r C F = k ∣ x F ) \hat{P}(X_r^{\mathrm{CF}}=k\mid x^F) P ^ ( X r CF = k ∣ x F ) for k = 1 , … , C k=1,\ldots,C k = 1 , … , C
Training
fit θ ^ , Σ θ \hat{\theta},\Sigma_\theta θ ^ , Σ θ by Laplace-approximating the profiled cutpoint posterior ▷ Lemma 6
q ← 0 ∈ R C \mathbf{q}\leftarrow0\in\mathbb{R}^C q ← 0 ∈ R C
for t = 1 , … , S θ t=1,\ldots,S_\theta t = 1 , … , S θ do ▷ marginalise over the cutpoint posterior
draw θ ( t ) ∼ N ( θ ^ , Σ θ ) \theta^{(t)}\sim\mathcal{N}(\hat{\theta},\Sigma_\theta) θ ( t ) ∼ N ( θ ^ , Σ θ ) ; set b c ← b c ( θ ( t ) ) b_c\leftarrow b_c(\theta^{(t)}) b c ← b c ( θ ( t ) ) via eq. equation 12
fit one latent GP under the ordinal-probit likelihood equation (14) at these cutpoints, by Laplace approximation ▷ Lemma 5
( μ F , s F 2 , μ ~ , s ~ 2 , ρ ) ← (\mu^F,s^{F2},\tilde{\mu},\tilde{s}^2,\rho)\leftarrow ( μ F , s F 2 , μ ~ , s ~ 2 , ρ ) ← joint two-point moments at ( x p a ( r ) F , x ~ p a ( r ) ) (x_{\mathrm{pa}(r)}^F,\tilde{x}_{\mathrm{pa}(r)}) ( x pa ( r ) F , x ~ pa ( r ) ) under this fit
for s = 1 , … , S f s=1,\ldots,S_f s = 1 , … , S f do ▷ marginalise over the GP posterior
draw ( f F , f ~ ) (f^F,\tilde{f}) ( f F , f ~ ) jointly from the bivariate Gaussian above
Abduction — the factual class confines N r N_r N r to one interval, eq. equation 15
α ← b c ∗ − 1 − f F ; β ← b c ∗ − f F \alpha\leftarrow b_{c^*-1}-f^F;\quad\beta\leftarrow b_{c^*}-f^F α ← b c ∗ − 1 − f F ; β ← b c ∗ − f F
Action and prediction — eq. equation 16; N r N_r N r is integrated out in closed form rather than sampled
for k = 1 , … , C k=1,\ldots,C k = 1 , … , C do
q k ← q k + Φ ( min ( β , b k − f ~ ) ) − Φ ( max ( α , b k − 1 − f ~ ) ) Φ ( β ) − Φ ( α ) / S f q_k\leftarrow q_k+\dfrac{\Phi(\min(\beta,b_k-\tilde{f}))-\Phi(\max(\alpha,b_{k-1}-\tilde{f}))}{\Phi(\beta)-\Phi(\alpha)}/S_f q k ← q k + Φ ( β ) − Φ ( α ) Φ ( min ( β , b k − f ~ )) − Φ ( max ( α , b k − 1 − f ~ )) / S f
end for
end for
end for
return q / S θ \mathbf{q}/S_\theta q / S θ
the naive form loses precision exactly for classes that were probable factually yet lost the arg max — 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.
Proofs
Throughout, { x i } i = 1 n \{\mathbf{x}^{i}\}_{i=1}^{n} { x i } i = 1 n denotes the observational sample, x F \mathbf{x}^{F} x F the factual individual, and where x F ∈ { x i } i = 1 n \mathbf{x}^{F} \in\{\mathbf{x}^{i}\}_{i=1}^{n} x F ∈ { x i } i = 1 n we write F ∈ [ n ] F \in[n] F ∈ [ n ] for its index. We write e F ∈ R n \mathbf{e}_{F} \in\mathbb{R}^{n} e F ∈ R n for the F F F -th standard basis vector, 1 n \mathbf{1}_{n} 1 n for the all-ones vector, and reserve x ~ pa ( r ) \tilde{\mathbf{x}}_{\operatorname{pa}(r)} x ~ pa ( r ) for the counterfactual parent configuration. All statements are made for a fixed r ∈ [ d ] r \in[d] r ∈ [ d ] with non-empty parent set ∣ pa ( r ) ∣ > 0 |\operatorname{pa}(r)| > 0 ∣ pa ( r ) ∣ > 0 ; the subscript r r r is suppressed wherever no ambiguity arises.
For the discrete results of §A.6.2, ℓ = ( ℓ 1 , … , ℓ C ) \ell= (\ell_{1}, \ldots, \ell_{C}) ℓ = ( ℓ 1 , … , ℓ C ) denotes a vector of log-probability scores entering a arg max \operatorname{arg\,max} arg max over classes, and M M M denotes the value of that maximum. We deliberately avoid a a a and M \mathcal{M} M for these objects: in the recourse literature [7 ] a = do ( X I = θ ) ∈ A F a = \operatorname{do}(X_{I} = \theta) \in\mathcal{A}^{F} a = do ( X I = θ ) ∈ A F is an action and M \mathcal{M} M is the SCM itself, and neither is what is meant here. The Gumbel vector G r \mathbf{G}_{r} G r plays the role of the exogenous U r U_{r} U r of that paper’s equation (1); we retain G G G because U U U is used in Corollary 2 for the induced scalar uniform noise of the binary mechanism.
Laplace machinery for the multiclass GPC
Notation and ordering conventions. For C > 2 C > 2 C > 2 the latent object is the n C nC n C -vector collecting C C C latent values per training point, and two orderings are in circulation. Write
f : = ( f r , 1 T , … , f r , C T ) T ∈ R n C (class-ordered) , f π : = P f (point-ordered) , (26) \mathbf{f} := \left(\mathbf{f}_{r,1}^{\mathsf{T}}, \ldots, \mathbf{f}_{r,C}^{\mathsf{T}}\right)^{\mathsf{T}} \in\mathbb{R}^{nC} \quad\text{(class-ordered)}, \qquad\mathbf{f}^{\pi} := P\mathbf{f} \quad\text{(point-ordered)}, \tag*{(26)} f := ( f r , 1 T , … , f r , C T ) T ∈ R n C (class-ordered) , f π := P f (point-ordered) , (26)
where f r , c : = ( f r , c ( x pa ( r ) 1 ) , … , f r , c ( x pa ( r ) n ) ) T \mathbf{f}_{r,c} := \left(f_{r,c}(\mathbf{x}^{1}_{\operatorname{pa}(r)}), \ldots, f_{r,c}(\mathbf{x}^{n}_{\operatorname{pa}(r)})\right)^{\mathsf{T}} f r , c := ( f r , c ( x pa ( r ) 1 ) , … , f r , c ( x pa ( r ) n ) ) T and P P P is the permutation sending index ( c − 1 ) n + i (c-1)n+i ( c − 1 ) n + i to ( i − 1 ) C + c (i-1)C+c ( i − 1 ) C + c . Since f r , 1 , … , f r , C f_{r,1}, \ldots, f_{r,C} f r , 1 , … , f r , C are independent GPs sharing the kernel k r k_{r} k r , the prior covariance of f \mathbf{f} f is
K r : = I C ⊗ K , K : = ( k r ( x pa ( r ) i , x pa ( r ) j ) ) i j (27) \mathcal{K}_{r} := I_{C} \otimes K, \qquad K := \left(k_{r}\left(\mathbf{x}^{i}_{\operatorname{pa}(r)},\mathbf{x}^{j}_{\operatorname{pa}(r)}\right)\right)_{ij} \tag*{(27)} K r := I C ⊗ K , K := ( k r ( x pa ( r ) i , x pa ( r ) j ) ) ij (27)
Let e r , c ∈ { 0 , 1 } n \mathbf{e}_{r,c} \in\{0,1\}^{n} e r , c ∈ { 0 , 1 } n have i i i -th entry I { x r i = c } \mathbb{I}\{x^{i}_{r}=c\} I { x r i = c } , let e ∈ R n C \mathbf{e} \in\mathbb{R}^{nC} e ∈ R n C be the class-ordered stack of the e r , c \mathbf{e}_{r,c} e r , c , and let π ∈ R n C \boldsymbol{\pi} \in\mathbb{R}^{nC} π ∈ R n C be the corresponding stack of π r , c \boldsymbol{\pi}_{r,c} π r , c , where π i ( f ) = softmax ( f r ( x pa ( r ) i ) ) ∈ R C \boldsymbol{\pi}_{i}(\mathbf{f}) = \operatorname{softmax}(\mathbf{f}_{r}(\mathbf{x}^{i}_{\operatorname{pa}(r)})) \in\mathbb{R}^{C} π i ( f ) = softmax ( f r ( x pa ( r ) i )) ∈ R C , 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 Ψ ( f ) : = log p ( x r ∣ f ) + log p ( f ∣ X pa ( r ) ) \Psi(\mathbf{f}) := \log p(\mathbf{x}_{r} \mid\mathbf{f}) + \log p(\mathbf{f} \mid\mathbf{X}_{\operatorname{pa}(r)}) Ψ ( f ) := log p ( x r ∣ f ) + log p ( f ∣ X pa ( r ) ) be the unnormalised log posterior of the multiclass GPC model, i.e. of the bare softmax likelihood P ( X r = c ∣ f ) = softmax ( f r ( x ) ) c P(X_{r} = c \mid\mathbf{f}) = \operatorname{softmax}(\mathbf{f}_{r}(\mathbf{x}))_{c} P ( X r = c ∣ f ) = softmax ( f r ( x ) ) c without the Gumbel-max coupling of Proposition 1’s eq. equation 1, with K ≻ 0 \mathbf{K} \succ0 K ≻ 0 . Then:
(i) ∇ Ψ ( f ) = ( e − π ) − K r − 1 f \nabla\Psi(\mathbf{f}) = (\mathbf{e} - \boldsymbol{\pi}) - \mathcal{K}_{r}^{-1}\mathbf{f} ∇Ψ ( f ) = ( e − π ) − K r − 1 f and ∇ 2 Ψ ( f ) = − W ( f ) − K r − 1 \nabla^{2}\Psi(\mathbf{f}) = -W(\mathbf{f}) - \mathcal{K}_{r}^{-1} ∇ 2 Ψ ( f ) = − W ( f ) − K r − 1 , where W ( f ) W(\mathbf{f}) W ( f ) is the n C × n C nC \times nC n C × n C matrix with P W ( f ) P T = blockdiag ( Λ 1 ( f ) , … , Λ n ( f ) ) P W(\mathbf{f}) P^{\mathsf{T}} = \operatorname{blockdiag}(\Lambda_{1}(\mathbf{f}), \ldots, \Lambda_{n}(\mathbf{f})) P W ( f ) P T = blockdiag ( Λ 1 ( f ) , … , Λ n ( f )) and Λ i ( f ) : = diag ( π i ) − π i π i T \Lambda_{i}(\mathbf{f}) := \operatorname{diag}(\boldsymbol{\pi}_{i}) - \boldsymbol{\pi}_{i}\boldsymbol{\pi}_{i}^{\mathsf{T}} Λ i ( f ) := diag ( π i ) − π i π i T (derived below);
(ii) W ( f ) ⪰ 0 W(\mathbf{f}) \succeq0 W ( f ) ⪰ 0 , with null space of dimension n n n ;
(iii) Ψ \Psi Ψ is strictly concave, hence has a unique maximiser f ^ r \hat{\mathbf{f}}_{r} f ^ r , characterised for each c ∈ { 1 , … , C } c \in\{1, \ldots, C\} c ∈ { 1 , … , C } by
f ^ r , c = K ( e r , c − π ^ r , c ) , π ^ r , c : = π r , c ( f ^ r ) ; (28) \hat{\mathbf{f}}_{r,c} = K(\mathbf{e}_{r,c} - \hat{\boldsymbol{\pi}}_{r,c}), \qquad\hat{\boldsymbol{\pi}}_{r,c} := \boldsymbol{\pi}_{r,c}(\hat{\mathbf{f}}_{r}); \tag*{(28)} f ^ r , c = K ( e r , c − π ^ r , c ) , π ^ r , c := π r , c ( f ^ r ) ; (28) :::`
(iv) the Laplace approximation to the latent posterior is q ( f r ∣ ⋅ ) = N ( f ^ r , ( K r − 1 + W ^ ) − 1 ) q(\mathbf{f}_r \mid\cdot) = \mathcal{N}(\hat{\mathbf{f}}_r,(\mathcal{K}_r^{-1}+\hat{W})^{-1}) q ( f r ∣ ⋅ ) = N ( f ^ r , ( K r − 1 + W ^ ) − 1 ) (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 x ⋆ \mathbf{x}^{\star} x ⋆ has, per class,
E q [ f r , c ( x ⋆ ) ] = k ⋆ T ( e r , c − π ^ r ) , Var q [ f r , c ( x ⋆ ) ] = k ⋆ − k ⋆ T ( K + W ^ c − 1 ) − 1 k ⋆ , (29) \mathbb{E}_q[f_{r,c}(\mathbf{x}^{\star})] = \mathbf{k}_{\star}^{\mathsf{T}}(\mathbf{e}_{r,c}-\hat{\boldsymbol{\pi}}_r), \qquad\operatorname{Var}_q[f_{r,c}(\mathbf{x}^{\star})] = k_{\star} - \mathbf{k}_{\star}^{\mathsf{T}}(\mathbf{K}+\hat{W}_c^{-1})^{-1}\mathbf{k}_{\star}, \tag*{(29)} E q [ f r , c ( x ⋆ )] = k ⋆ T ( e r , c − π ^ r ) , Var q [ f r , c ( x ⋆ )] = k ⋆ − k ⋆ T ( K + W ^ c − 1 ) − 1 k ⋆ , (29)
with k ⋆ : = ( k r ( x ⋆ , x p a ( r ) i ) ) i = 1 n \mathbf{k}_{\star} := (k_r(\mathbf{x}^{\star},\mathbf{x}^{i}_{\mathrm{pa}(r)}))_{i=1}^{n} k ⋆ := ( k r ( x ⋆ , x pa ( r ) i ) ) i = 1 n , k ⋆ : = k r ( x ⋆ , x ⋆ ) k_{\star} := k_r(\mathbf{x}^{\star},\mathbf{x}^{\star}) k ⋆ := k r ( x ⋆ , x ⋆ ) and W ^ c : = diag ( π ^ i , c ( 1 − π ^ i , c ) ) i = 1 n \hat{W}_c := \operatorname{diag}(\hat{\pi}_{i,c}(1-\hat{\pi}_{i,c}))_{i=1}^{n} W ^ c := diag ( π ^ i , c ( 1 − π ^ i , c ) ) i = 1 n . More generally, for two inputs x ⋆ , x † \mathbf{x}^{\star},\mathbf{x}^{\dagger} x ⋆ , x † ,
Cov q [ f r , c ( x ⋆ ) , f r , c ( x † ) ] = k r ( x ⋆ , x † ) − k ⋆ T ( K + W ^ c − 1 ) − 1 k † . (30) \operatorname{Cov}_q[f_{r,c}(\mathbf{x}^{\star}),f_{r,c}(\mathbf{x}^{\dagger})] = k_r(\mathbf{x}^{\star},\mathbf{x}^{\dagger})-\mathbf{k}_{\star}^{\mathsf{T}}(\mathbf{K}+\hat{W}_c^{-1})^{-1}\mathbf{k}_{\dagger}. \tag*{(30)} Cov q [ f r , c ( x ⋆ ) , f r , c ( x † )] = k r ( x ⋆ , x † ) − k ⋆ T ( K + W ^ c − 1 ) − 1 k † . (30)
Proof. (i) The bare softmax likelihood factorises over training points, so
Ψ ( f ) = ∑ i = 1 n [ f r , x i ( x p a ( r ) i ) − log ∑ c = 1 C exp f r , c ( x p a ( r ) i ) ] − 1 2 f T K r − 1 f + c o n s t , (31) \Psi(\mathbf{f})=\sum_{i=1}^{n}\left[f_{r,x_i}(\mathbf{x}^{i}_{\mathrm{pa}(r)})-\log\sum_{c=1}^{C}\exp f_{r,c}(\mathbf{x}^{i}_{\mathrm{pa}(r)})\right]-\frac{1}{2}\mathbf{f}^{\mathsf{T}}\mathcal{K}_r^{-1}\mathbf{f}+\mathrm{const}, \tag*{(31)} Ψ ( f ) = i = 1 ∑ n [ f r , x i ( x pa ( r ) i ) − log c = 1 ∑ C exp f r , c ( x pa ( r ) i ) ] − 2 1 f T K r − 1 f + const , (31)
the constant absorbing − 1 2 log ∣ K r ∣ − n C 2 log 2 π -\frac{1}{2}\log|\mathcal{K}_r|-\frac{nC}{2}\log2\pi − 2 1 log ∣ K r ∣ − 2 n C log 2 π . Differentiating the i i i -th bracket in f r , c ( x p a ( r ) i ) f_{r,c}(\mathbf{x}^{i}_{\mathrm{pa}(r)}) f r , c ( x pa ( r ) i ) gives I { x i r = c } − π i , c \mathbb{I}\{x_i^r=c\}-\pi_{i,c} I { x i r = c } − π i , c , which stacks to e − π \mathbf{e}-\boldsymbol{\pi} e − π ; differentiating − 1 2 f T K r − 1 f -\frac{1}{2}\mathbf{f}^{\mathsf{T}}\mathcal{K}_r^{-1}\mathbf{f} − 2 1 f T K r − 1 f gives − K r − 1 f -\mathcal{K}_r^{-1}\mathbf{f} − K r − 1 f . Differentiating once more, the second derivative of the i i i -th bracket with respect to ( f r , c ( x p a ( r ) i ) ) c = 1 C (f_{r,c}(\mathbf{x}^{i}_{\mathrm{pa}(r)}))_{c=1}^{C} ( f r , c ( x pa ( r ) i ) ) c = 1 C is − ( diag ( π i ) − π i π i T ) = − Λ i ( f ) -(\operatorname{diag}(\boldsymbol{\pi}_i)-\boldsymbol{\pi}_i\boldsymbol{\pi}_i^{\mathsf{T}})=-\Lambda_i(\mathbf{f}) − ( diag ( π i ) − π i π i T ) = − Λ i ( f ) , and mixed derivatives across distinct training points vanish because the likelihood factorises.
(ii) For v ∈ R n C \mathbf{v}\in\mathbb{R}^{nC} v ∈ R n C with point-ordered blocks v i ∈ R C \mathbf{v}_i\in\mathbb{R}^{C} v i ∈ R C ,
v T W v = ∑ i = 1 n v i T Λ i v i = ∑ i = 1 n [ ∑ c π i , c v i , c 2 − ( ∑ c π i , c v i , c ) 2 ] = ∑ i = 1 n Var c ∼ π i [ v i , c ] ≥ 0. (32) \mathbf{v}^{\mathsf{T}}W\mathbf{v}=\sum_{i=1}^{n}\mathbf{v}_i^{\mathsf{T}}\Lambda_i\mathbf{v}_i=\sum_{i=1}^{n}\left[\sum_c\pi_{i,c}v_{i,c}^{2}-\left(\sum_c\pi_{i,c}v_{i,c}\right)^2\right]=\sum_{i=1}^{n}\operatorname{Var}_{c\sim\pi_i}[v_{i,c}]\geq0. \tag*{(32)} v T W v = i = 1 ∑ n v i T Λ i v i = i = 1 ∑ n c ∑ π i , c v i , c 2 − ( c ∑ π i , c v i , c ) 2 = i = 1 ∑ n Var c ∼ π i [ v i , c ] ≥ 0. (32)
The variance in equation (32) vanishes iff v i , c v_{i,c} v i , c is constant in c c c for each i i i (as π i , c > 0 \pi_{i,c}>0 π i , c > 0 for all c c c ), i.e. iff v i ∈ span { 1 C } \mathbf{v}_i\in\operatorname{span}\{\mathbf{1}_C\} v i ∈ span { 1 C } ; the null space of W W W therefore has dimension exactly n n n . This degeneracy is the shift-invariance of the softmax, softmax ( f i + a 1 C ) = softmax ( f i ) \operatorname{softmax}(\mathbf{f}_i+a\mathbf{1}_C)=\operatorname{softmax}(\mathbf{f}_i) softmax ( f i + a 1 C ) = softmax ( f i ) .
(iii) By (i) and (ii), ∇ 2 Ψ = − W − K r − 1 ≺ 0 \nabla^2\Psi=-W-\mathcal{K}_r^{-1}\prec0 ∇ 2 Ψ = − W − K r − 1 ≺ 0 everywhere, since W ⪰ 0 W\succeq0 W ⪰ 0 and K r − 1 = I C ⊗ K − 1 ≻ 0 \mathcal{K}_r^{-1}=I_C\otimes K^{-1}\succ0 K r − 1 = I C ⊗ K − 1 ≻ 0 . Hence Ψ \Psi Ψ is strictly concave and, being coercive, attains a unique global maximum f ^ r \hat{\mathbf{f}}_r f ^ r . Note that it is the GP prior, not the likelihood, that removes the softmax degeneracy and makes the MAP well defined. Setting ∇ Ψ = 0 \nabla\Psi=0 ∇Ψ = 0 gives K r − 1 f ^ r = e − π ^ \mathcal{K}_r^{-1}\hat{\mathbf{f}}_r=\mathbf{e}-\hat{\boldsymbol{\pi}} K r − 1 f ^ r = e − π ^ , i.e. f ^ r = K r ( e − π ^ ) \hat{\mathbf{f}}_r=\mathcal{K}_r(\mathbf{e}-\hat{\boldsymbol{\pi}}) f ^ r = K r ( e − π ^ ) . Since K r = I C ⊗ K \mathcal{K}_r=I_C\otimes K K r = I C ⊗ K is block diagonal in the class-ordered layout, this decouples across c c c into equation (28) .
(iv) Since ∇ Ψ ( f ^ r ) = 0 \nabla\Psi(\hat{\mathbf{f}}_r)=0 ∇Ψ ( f ^ r ) = 0 , the second-order Taylor expansion of Ψ \Psi Ψ at its mode is Ψ ( f ) = Ψ ( f ^ r ) − 1 2 ( f − f ^ r ) T ( K r − 1 + W ^ ) ( f − f ^ r ) + O ( ∥ f − f ^ r ∥ 3 ) \Psi(\mathbf{f})=\Psi(\hat{\mathbf{f}}_r)-\frac{1}{2}(\mathbf{f}-\hat{\mathbf{f}}_r)^{\mathsf{T}}(\mathcal{K}_r^{-1}+\hat{W})(\mathbf{f}-\hat{\mathbf{f}}_r)+O(\lVert\mathbf{f}-\hat{\mathbf{f}}_r\rVert^3) Ψ ( f ) = Ψ ( f ^ r ) − 2 1 ( f − f ^ r ) T ( K r − 1 + W ^ ) ( f − f ^ r ) + O (∥ f − f ^ r ∥ 3 ) ; exponentiating and normalising the quadratic part gives the stated Gaussian [21 , 19 ] , whose covariance is well defined because K r − 1 + W ^ ≻ 0 \mathcal{K}_r^{-1}+\hat{W}\succ0 K r − 1 + W ^ ≻ 0 by (ii)–(iii) notwithstanding the singularity of W ^ \hat{W} W ^ . For the predictive moments, f r , c ( x ⋆ ) ∣ f r , c ∼ N ( k ⋆ T K − 1 f r , c , k ⋆ − k ⋆ T K − 1 k ⋆ ) f_{r,c}(\mathbf{x}^{\star})\mid f_{r,c}\sim\mathcal{N}(\mathbf{k}_{\star}^{\mathsf{T}}K^{-1}f_{r,c},k_{\star}-\mathbf{k}_{\star}^{\mathsf{T}}K^{-1}\mathbf{k}_{\star}) f r , c ( x ⋆ ) ∣ f r , c ∼ N ( k ⋆ T K − 1 f r , c , k ⋆ − k ⋆ T K − 1 k ⋆ ) by the GP prior; marginalising over q q q 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 c c c -th diagonal block of ( K r − 1 + W ^ ) − 1 (\mathcal{K}_r^{-1}+\hat{W})^{-1} ( K r − 1 + W ^ ) − 1 by ( K − 1 + W ^ c ) − 1 (K^{-1}+\hat{W}_c)^{-1} ( K − 1 + W ^ c ) − 1 and applying the Woodbury identity K − 1 − K − 1 ( K − 1 + W ^ c ) − 1 K − 1 = ( K + W ^ c − 1 ) − 1 K^{-1}-K^{-1}(K^{-1}+\hat{W}_c)^{-1}K^{-1}=(K+\hat{W}_c^{-1})^{-1} K − 1 − K − 1 ( K − 1 + W ^ c ) − 1 K − 1 = ( K + W ^ c − 1 ) − 1 , legitimate because 0 < π ^ i , c < 1 0<\hat{\pi}_{i,c}<1 0 < π ^ i , c < 1 makes W ^ c \hat{W}_c W ^ c invertible. Equation equation 30 is the same computation with k ⋆ \mathbf{k}_{\star} k ⋆ and k † \mathbf{k}_{\dagger} k † in the two slots. □ \square □
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 C C C 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 ( f c F , f c ) (f_c^{F},f_c) ( f c F , f c ) , 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 p \mathbf{p} p is estimated but not the counterfactual construction, because the coupling is stated on log p \log\mathbf{p} log p . The compatibility identity, the abduction of Lemma 3 and Corollary 1 all go through unchanged; only the accuracy of p \mathbf{p} p is affected—which is exactly what the T V i n t \mathrm{TV}_{\mathrm{int}} TV int column of §4’s table measures. At C = 2 C=2 C = 2 the two approximations coincide and Corollary 2 applies as stated.
Proof of Proposition, Corollary (consistency) and Corollary (binary)
Lemma 2 (Gumbel-max representation [4 ] (Yellott 1977)). Let ℓ = ( ℓ 1 , … , ℓ C ) ∈ R C \boldsymbol{\ell} = (\ell_1,\ldots,\ell_C) \in\mathbb{R}^C ℓ = ( ℓ 1 , … , ℓ C ) ∈ R C be any score vector and G 1 , … , G C ∼ i i d Gumbel ( 0 , 1 ) G_1,\ldots,G_C \stackrel{\mathrm{iid}}{\sim} \operatorname{Gumbel}(0,1) G 1 , … , G C ∼ iid Gumbel ( 0 , 1 ) . Then
P ( arg max c { ℓ c + G c } = c ∗ ) = softmax ( ℓ ) c ∗ , max c { ℓ c + G c } ∼ Gumbel ( log ∑ c e ℓ c , 1 ) , (33) P\left(\mathop{\arg\max}_{c}\{\ell_c+G_c\}=c^*\right)=\operatorname{softmax}(\boldsymbol{\ell})_{c^*},\qquad\max_{c}\{\ell_c+G_c\}\sim\operatorname{Gumbel}\left(\log\sum_c e^{\ell_c},1\right), \tag*{(33)} P ( arg max c { ℓ c + G c } = c ∗ ) = softmax ( ℓ ) c ∗ , c max { ℓ c + G c } ∼ Gumbel ( log c ∑ e ℓ c , 1 ) , (33) and the arg max and the max are independent.
Proof. ℓ c + G c ∼ Gumbel ( ℓ c , 1 ) \ell_c+G_c\sim\operatorname{Gumbel}(\ell_c,1) ℓ c + G c ∼ Gumbel ( ℓ c , 1 ) with CDF exp ( − e − ( t − ℓ c ) ) \exp(-e^{-(t-\ell_c)}) exp ( − e − ( t − ℓ c ) ) . By independence, P ( max c { ℓ c + G c } ≤ t ) = ∏ c exp ( − e − ( t − ℓ c ) ) = exp ( − e − t ∑ c e ℓ c ) = exp ( − e − ( t − log ∑ c e ℓ c ) ) P(\max_c\{\ell_c+G_c\}\leq t)=\prod_c\exp(-e^{-(t-\ell_c)})=\exp(-e^{-t}\sum_c e^{\ell_c})=\exp(-e^{-(t-\log\sum_c e^{\ell_c})}) P ( max c { ℓ c + G c } ≤ t ) = ∏ c exp ( − e − ( t − ℓ c ) ) = exp ( − e − t ∑ c e ℓ c ) = exp ( − e − ( t − l o g ∑ c e ℓ c ) ) , which is the second claim. For the first, condition on G c ∗ G_{c^*} G c ∗ and integrate:
P ( arg max c { ℓ c + G c } = c ∗ ) = ∫ R e − ( g − ℓ c ∗ ) e − e − ( g − ℓ c ∗ ) ∏ c ≠ c ∗ exp ( − e − ( g − ℓ c ) ) d g . (34) P(\mathop{\arg\max}_{c}\{\ell_c+G_c\}=c^*)=\int_{\mathbb{R}}e^{-(g-\ell_{c^*})}e^{-e^{-(g-\ell_{c^*})}}\prod_{c\ne c^*}\exp(-e^{-(g-\ell_c)})\,\mathrm{d}g. \tag*{(34)} P ( arg max c { ℓ c + G c } = c ∗ ) = ∫ R e − ( g − ℓ c ∗ ) e − e − ( g − ℓ c ∗ ) c = c ∗ ∏ exp ( − e − ( g − ℓ c ) ) d g . (34)
Substituting z : = e − g z:=e^{-g} z := e − g , d z = − e − g d g \mathrm{d}z=-e^{-g}\mathrm{d}g d z = − e − g d g , the integrand becomes e ℓ c ∗ exp ( − z ∑ c e ℓ c ) d z e^{\ell_{c^*}}\exp(-z\sum_c e^{\ell_c})\mathrm{d}z e ℓ c ∗ exp ( − z ∑ c e ℓ c ) d z on z ∈ ( 0 , ∞ ) z\in(0,\infty) z ∈ ( 0 , ∞ ) , whence equation 34 equals e ℓ c ∗ / ∑ c e ℓ c e^{\ell_{c^*}}/\sum_c e^{\ell_c} e ℓ c ∗ / ∑ c e ℓ c . Independence of the arg max and the max is the standard consequence of the same computation, the conditional law of the maximum given arg max = c ∗ =c^* = c ∗ being free of c ∗ c^* c ∗ .
Lemma 3 (Posterior of the Gumbel vector given the realised class [11 ] ). In the setting of Lemma 2, condition on arg max c { ℓ c + G c } = c ∗ \arg\max_c\{\ell_c+G_c\}=c^* arg max c { ℓ c + G c } = c ∗ . Let M : = max c { ℓ c + G c } M:=\max_c\{\ell_c+G_c\} M := max c { ℓ c + G c } . Then M ∼ Gumbel ( log ∑ c e ℓ c , 1 ) M\sim\operatorname{Gumbel}(\log\sum_c e^{\ell_c},1) M ∼ Gumbel ( log ∑ c e ℓ c , 1 ) , and given M M M the coordinates are conditionally independent with
G c ∗ = M − ℓ c ∗ , G c ∣ M ∼ Gumbel ( 0 , 1 ) conditioned on G c ≤ M − ℓ c , c ≠ c ∗ . (35) G_{c^*}=M-\ell_{c^*},\qquad G_c\mid M\sim\operatorname{Gumbel}(0,1)\ \text{conditioned on}\ G_c\leq M-\ell_c,\quad c\ne c^*. \tag*{(35)} G c ∗ = M − ℓ c ∗ , G c ∣ M ∼ Gumbel ( 0 , 1 ) conditioned on G c ≤ M − ℓ c , c = c ∗ . (35) Consequently equation 3 samples the posterior exactly.
Proof. The event { arg max = c ∗ , M ∈ d m } \{\arg\max=c^*,M\in\mathrm{d}m\} { arg max = c ∗ , M ∈ d m } is { ℓ c ∗ + G c ∗ ∈ d m } ∩ ⋂ c ≠ c ∗ { ℓ c + G c ≤ m } \{\ell_{c^*}+G_{c^*}\in\mathrm{d}m\}\cap\bigcap_{c\ne c^*}\{\ell_c+G_c\leq m\} { ℓ c ∗ + G c ∗ ∈ d m } ∩ ⋂ c = c ∗ { ℓ c + G c ≤ m } . Given M = m M=m M = m , the coordinate c ∗ c^* c ∗ is determined, G c ∗ = m − ℓ c ∗ G_{c^*}=m-\ell_{c^*} G c ∗ = m − ℓ c ∗ , and the remaining coordinates are independent (by independence of the G c G_c G c ) each conditioned on the event { ℓ c + G c ≤ m } \{\ell_c+G_c\leq m\} { ℓ c + G c ≤ m } , i.e. { G c ≤ m − ℓ c } \{G_c\leq m-\ell_c\} { G c ≤ m − ℓ c } . That M ∼ Gumbel ( log ∑ c e ℓ c , 1 ) M\sim\operatorname{Gumbel}(\log\sum_c e^{\ell_c},1) M ∼ Gumbel ( log ∑ c e ℓ c , 1 ) unconditionally, and independently of the arg max, is Lemma 2; hence its conditional law given arg max = c ∗ =c^* = c ∗ is the same. For the sampler, if G ∼ Gumbel ( 0 , 1 ) G\sim\operatorname{Gumbel}(0,1) G ∼ Gumbel ( 0 , 1 ) conditioned on G ≤ b G\leq b G ≤ b then its CDF is exp ( − e − g ) / exp ( − e − b ) \exp(-e^{-g})/\exp(-e^{-b}) exp ( − e − g ) / exp ( − e − b ) for g ≤ b g\leq b g ≤ b ; setting this equal to V ∼ Uniform ( 0 , 1 ) V\sim\operatorname{Uniform}(0,1) V ∼ Uniform ( 0 , 1 ) and solving gives e − g = e − b − log V e^{-g}=e^{-b}-\log V e − g = e − b − log V , i.e. g = − log ( e − b − log V ) g=-\log(e^{-b}-\log V) g = − log ( e − b − log V ) , which with b = m − ℓ c b=m-\ell_c b = m − ℓ c is the expression in equation 3. Note e − b − log V > 0 e^{-b}-\log V>0 e − b − log V > 0 almost surely, so the logarithm is well defined.
Proof of Proposition 1. Compatibility. Apply Lemma 2 with ℓ c = log p c ( x ) \ell_c=\log p_c(\mathbf{x}) ℓ c = log p c ( x ) . For any probability vector p \mathbf{p} p ,
softmax ( log p ) c = p c ∑ c ′ p c ′ = p c , (36) \operatorname{softmax}(\log\mathbf{p})_c=\frac{p_c}{\sum_{c'}p_{c'}}=p_c, \tag*{(36)} softmax ( log p ) c = ∑ c ′ p c ′ p c = p c , (36)
so equation 33 gives equation 2 directly, for arbitrary p \mathbf{p} p . Since G r \mathbf{G}_r G r is independent of the latent and of everything upstream, and do ( X p a ( r ) = x ~ p a ( r ) ) \operatorname{do}(X_{\mathrm{pa}(r)}=\tilde{\mathbf{x}}_{\mathrm{pa}(r)}) do ( X pa ( r ) = x ~ pa ( r ) ) removes only the equations for X p a ( r ) X_{\mathrm{pa}(r)} X pa ( r ) ,
P ( X r = c ∣ do ( X p a ( r ) = x ~ p a ( r ) ) ) = p c ( x ~ p a ( r ) ) , (37) P(X_r=c\mid\operatorname{do}(\mathbf{X}_{\mathrm{pa}(r)}=\tilde{\mathbf{x}}_{\mathrm{pa}(r)}))=p_c(\tilde{\mathbf{x}}_{\mathrm{pa}(r)}), \tag*{(37)} P ( X r = c ∣ do ( X pa ( r ) = x ~ pa ( r ) )) = p c ( x ~ pa ( r ) ) , (37)
so equation 1 matches the fitted model on all observational and interventional distributions.
The coupling must sit on log p \log\mathbf{p} log p , not on f r \mathbf{f}_r f r . Under the joint Laplace fit, softmax ( f r ) c = p c \operatorname{softmax}(\mathbf{f}_r)_c=p_c softmax ( f r ) c = p c , so
log p c = f r , c − log ∑ c ′ e f r , c ′ = f r , c − Z ( x ) (38) \log p_c=f_{r,c}-\log\sum_{c'}e^{f_{r,c'}}=f_{r,c}-Z(\mathbf{x}) \tag*{(38)} log p c = f r , c − log c ′ ∑ e f r , c ′ = f r , c − Z ( x ) (38)
with Z ( x ) : = log ∑ c ′ e f r , c ′ Z(\mathbf{x}):=\log\sum_{c'}e^{f_{r,c'}} Z ( x ) := log ∑ c ′ e f r , c ′ a shift invisible to arg max, so coupling on f r \mathbf{f}_r f r or on log p \log\mathbf{p} log p agree. Under a one-versus-rest fit, p c ∝ σ ( f r , c ) p_c\propto\sigma(f_{r,c}) p c ∝ σ ( f r , c ) , so softmax ( f r ) ≠ p \operatorname{softmax}(\mathbf{f}_r)\ne\mathbf{p} softmax ( f r ) = p in general and coupling on f r \mathbf{f}_r f r would violate equation 2; only log p \log\mathbf{p} log p works for both.
Abduction. Equation equation (1) is a structural equation with G r \mathbf{G}_r G r exogenous, unit-specific and independent across units, so Step 1 asks for P G r ∣ x F P_{\mathbf{G}_r\mid x^F} P G r ∣ x F . Given ℓ F \ell^F ℓ F , Lemma 3 with ℓ c = ℓ c F = log p c ( x p a ( r ) F ) \ell_c=\ell^F_c=\log p_c(x^F_{\mathrm{pa}(r)}) ℓ c = ℓ c F = log p c ( x pa ( r ) F ) , c ∗ = x r F c^*=x^F_r c ∗ = x r F gives exactly equation (3) . Since ℓ F = log p \ell^F=\log\mathbf{p} ℓ F = log p is normalised, ∑ c e ℓ c F = 1 \sum_c e^{\ell^F_c}=1 ∑ c e ℓ c F = 1 and M ∼ Gumbel ( 0 , 1 ) M\sim\operatorname{Gumbel}(0,1) M ∼ Gumbel ( 0 , 1 ) here; equation (3) retains the general location because it also holds for unnormalised scores.
Action and prediction. Fixing f r f_r f r , G r \mathbf{G}_r G r and substituting the argument gives equation (4) . As only the Laplace posterior of f r f_r f r is known, ( f F , f ~ ) (\mathbf{f}^F,\tilde{\mathbf{f}}) ( f F , f ~ ) is drawn jointly, with moments given by Lemma 1(iv) — equation (29) , equation (30) at x ∗ = x p a ( r ) F x^*=x^F_{\mathrm{pa}(r)} x ∗ = x pa ( r ) F , † = x ~ p a ( r ) \dagger=\tilde{x}_{\mathrm{pa}(r)} † = x ~ pa ( r ) — the covariance being equation (5) . Taking expectation of the indicator in equation (4) over G r ∣ x r F , f F \mathbf{G}_r\mid x^F_r,\mathbf{f}^F G r ∣ x r F , f F then ( f F , f ~ ) (\mathbf{f}^F,\tilde{\mathbf{f}}) ( f F , f ~ ) ,
P ( X r C F = c ∣ x r F ) = E ( f F , f ~ ) E G r ∣ x r F , f F [ I { arg max c ′ { ℓ ~ c ′ + G r , c ′ } = c } ] , (39) P(X^{\mathrm{CF}}_r=c\mid x^F_r)=\mathbb{E}_{(\mathbf{f}^F,\tilde{\mathbf{f}})}\mathbb{E}_{\mathbf{G}_r\mid x^F_r,\mathbf{f}^F}\left[\mathbb{I}\left\{\underset{c'}{\arg\max}\{\tilde{\ell}_{c'}+G_{r,c'}\}=c\right\}\right], \tag*{(39)} P ( X r CF = c ∣ x r F ) = E ( f F , f ~ ) E G r ∣ x r F , f F [ I { c ′ arg max { ℓ ~ c ′ + G r , c ′ } = c } ] , (39)
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 Δ C − 1 \Delta^{C-1} Δ C − 1 , so the empirical average lies in Δ C − 1 \Delta^{C-1} Δ C − 1 at every finite sample size and is a valid categorical distribution.
The pair ( f F , f ~ ) (\mathbf{f}^F,\tilde{\mathbf{f}}) ( f F , f ~ ) in abduction equation (35) and prediction equation (4) must be the same draw : f r f_r f r 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 x ~ p a ( r ) = x p a ( r ) F \tilde{x}_{\mathrm{pa}(r)}=x^F_{\mathrm{pa}(r)} x ~ pa ( r ) = x pa ( r ) F , so k ∗ = k † \mathbf{k}^*=\mathbf{k}^{\dagger} k ∗ = k † in equation (30) . Then
Var q [ f c F − f ~ c ] = Var q [ f c F ] + Var q [ f ~ c ] − 2 Cov q [ f c F , f ~ c ] = 0 , hence f ~ = f F almost surely . (40) \operatorname{Var}_q[f^F_c-\tilde{f}_c]=\operatorname{Var}_q[f^F_c]+\operatorname{Var}_q[\tilde{f}_c]-2\operatorname{Cov}_q[f^F_c,\tilde{f}_c]=0,\qquad\text{hence}\qquad\tilde{\mathbf{f}}=\mathbf{f}^F\text{ almost surely}. \tag*{(40)} Var q [ f c F − f ~ c ] = Var q [ f c F ] + Var q [ f ~ c ] − 2 Cov q [ f c F , f ~ c ] = 0 , hence f ~ = f F almost surely . (40)
Since ℓ = log p \ell=\log\mathbf{p} ℓ = log p is a deterministic function of f \mathbf{f} f , equation (40) gives
ℓ ~ = ℓ F almost surely . (41) \tilde{\ell}=\ell^F\quad\text{almost surely}. \tag*{(41)} ℓ ~ = ℓ F almost surely . (41)
By Lemma 3, conditioning the abduction on x r F = c ∗ x^F_r=c^* x r F = c ∗ gives, with M = max c { ℓ c F + G r , c } M=\max_c\{\ell^F_c+G_{r,c}\} M = max c { ℓ c F + G r , c } ,
ℓ c ∗ F + G r , c ∗ = M , ℓ c F + G r , c < M ( c ≠ c ∗ ) , (42) \ell^F_{c^*}+G_{r,c^*}=M,\qquad\ell^F_c+G_{r,c}<M\quad(c\ne c^*), \tag*{(42)} ℓ c ∗ F + G r , c ∗ = M , ℓ c F + G r , c < M ( c = c ∗ ) , (42)
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 ℓ ~ \tilde{\ell} ℓ ~ :
ℓ ~ c ∗ + G r , c ∗ = ℓ c ∗ F + G r , c ∗ = M > ℓ c F + G r , c = ℓ ~ c + G r , c , c ≠ c ∗ , (43) \tilde{\ell}_{c^*}+G_{r,c^*}=\ell^F_{c^*}+G_{r,c^*}=M>\ell^F_c+G_{r,c}=\tilde{\ell}_c+G_{r,c},\qquad c\ne c^*, \tag*{(43)} ℓ ~ c ∗ + G r , c ∗ = ℓ c ∗ F + G r , c ∗ = M > ℓ c F + G r , c = ℓ ~ c + G r , c , c = c ∗ , (43)
so
arg max c { ℓ ~ c + G r , c } = c ∗ = x r F almost surely . (44) \underset{c}{\arg\max}\{\tilde{\ell}_c+G_{r,c}\}=c^*=x^F_r\quad\text{almost surely}. \tag*{(44)} c arg max { ℓ ~ c + G r , c } = c ∗ = x r F almost surely . (44)
Since this indicator equals x r F x^F_r x r F almost surely, averaging it in equation (6) returns the point mass at x r F x^F_r x r F , which is equation (7) .
Remark. Two points bear on the implementation. Equation (40) requires f F \mathbf{f}^F f F and f ~ \tilde{\mathbf{f}} f ~ to be the same posterior draw; sampling them independently from their marginals breaks it. And equation (44) uses no property of p \mathbf{p} p 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 C = 2 C=2 C = 2 , shift-invariance of the arg max under f ↦ f + a 1 2 \mathbf{f}\mapsto\mathbf{f}+a\mathbf{1}_2 f ↦ f + a 1 2 lets us write the event { X r = 1 } \{X_r=1\} { X r = 1 } as { f r , 1 + G r , 1 > f r , 2 + G r , 2 } = { G r , 2 − G r , 1 < f r } \{f_{r,1}+G_{r,1}>f_{r,2}+G_{r,2}\}=\{G_{r,2}-G_{r,1}<f_r\} { f r , 1 + G r , 1 > f r , 2 + G r , 2 } = { G r , 2 − G r , 1 < f r } with f r : = f r , 1 − f r , 2 f_r:=f_{r,1}-f_{r,2} f r := f r , 1 − f r , 2 . The difference of two independent standard Gumbels is standard logistic: for L : = G r , 2 − G r , 1 L:=G_{r,2}-G_{r,1} L := G r , 2 − G r , 1 ,
P ( L ≤ t ) = ∫ R exp ( − e − ( g + t ) ) e − g exp ( − e − g ) d g = 1 1 + e − t = σ ( t ) , (45) P(L\le t)=\int_{\mathbb{R}}\exp\left(-e^{-(g+t)}\right)e^{-g}\exp\left(-e^{-g}\right)\,dg=\frac{1}{1+e^{-t}}=\sigma(t), \tag*{(45)} P ( L ≤ t ) = ∫ R exp ( − e − ( g + t ) ) e − g exp ( − e − g ) d g = 1 + e − t 1 = σ ( t ) , (45)
by the substitution z = e − g z=e^{-g} z = e − g , which turns the integral into ∫ 0 ∞ e − z ( 1 + e − t ) d z = ( 1 + e − t ) − 1 \int_{0}^{\infty}e^{-z(1+e^{-t})}\,dz=(1+e^{-t})^{-1} ∫ 0 ∞ e − z ( 1 + e − t ) d z = ( 1 + e − t ) − 1 . Setting U r : = σ ( L ) U_r:=\sigma(L) U r := σ ( L ) , which is Uniform( 0 , 1 ) (0,1) ( 0 , 1 ) because σ \sigma σ is the CDF of L L L , and using strict monotonicity of σ \sigma σ ,
{ X r = 1 } = { L < f r } = { σ ( L ) < σ ( f r ) } = { U r < p } , p : = σ ( f r ) , (46) \{X_r=1\}=\{L<f_r\}=\{\sigma(L)<\sigma(f_r)\}=\{U_r<p\},\qquad p:=\sigma(f_r), \tag*{(46)} { X r = 1 } = { L < f r } = { σ ( L ) < σ ( f r )} = { U r < p } , p := σ ( f r ) , (46)
which is equation equation 8.
Abduction. By equation 46 the observation x r F = 1 x_r^F=1 x r F = 1 is equivalent to U r < p F U_r<p^F U r < p F , and x r F = 0 x_r^F=0 x r F = 0 to U r ≥ p F U_r\ge p^F U r ≥ p F . Since U r U_r U r is uniform and independent of f r f_r f r , 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 f r f_r f r , and hence on p F p^F p F and p C F p^{\mathrm{CF}} p CF , the counterfactual event is { U r < p C F } \{U_r<p^{\mathrm{CF}}\} { U r < p CF } with U r U_r U r drawn from equation 9. If x r F = 1 x_r^F=1 x r F = 1 then U r ∼ Uniform ( 0 , p F ) U_r\sim\operatorname{Uniform}(0,p^F) U r ∼ Uniform ( 0 , p F ) and
P ( U r < p C F ) = ∣ ( 0 , p C F ) ∩ ( 0 , p F ) ∣ p F = min ( p C F , p F ) p F , (47) P(U_r<p^{\mathrm{CF}})=\frac{\left|(0,p^{\mathrm{CF}})\cap(0,p^F)\right|}{p^F}=\frac{\min(p^{\mathrm{CF}},p^F)}{p^F}, \tag*{(47)} P ( U r < p CF ) = p F ( 0 , p CF ) ∩ ( 0 , p F ) = p F min ( p CF , p F ) , (47)
while if x r F = 0 x_r^F=0 x r F = 0 then U r ∼ Uniform ( p F , 1 ) U_r\sim\operatorname{Uniform}(p^F,1) U r ∼ Uniform ( p F , 1 ) and
P ( U r < p C F ) = ∣ ( p F , 1 ) ∩ ( 0 , p C F ) ∣ 1 − p F = max ( 0 , p C F − p F ) 1 − p F , (48) P(U_r<p^{\mathrm{CF}})=\frac{\left|(p^F,1)\cap(0,p^{\mathrm{CF}})\right|}{1-p^F}=\frac{\max(0,p^{\mathrm{CF}}-p^F)}{1-p^F}, \tag*{(48)} P ( U r < p CF ) = 1 − p F ( p F , 1 ) ∩ ( 0 , p CF ) = 1 − p F max ( 0 , p CF − p F ) , (48)
which together are equation equation 10. Marginalising over the joint Laplace posterior of ( f F , f ~ ) (f^F,\tilde f) ( f F , f ~ ) , whose moments are equation 29–equation 30 at C = 2 C=2 C = 2 , gives equation equation 11.
Consistency and monotonicity. Setting x ~ p a ( r ) = x p a ( r ) F \tilde{x}_{\mathrm{pa}(r)}=x^F_{\mathrm{pa}(r)} x ~ pa ( r ) = x pa ( r ) F gives p C F = p F p^{\mathrm{CF}}=p^F p CF = p F 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 p C F p^{\mathrm{CF}} p CF , so the counterfactual probability is monotone in the intervention whenever p ( ⋅ ) p(\cdot) p ( ⋅ ) 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 x ~ p a ( r ) \tilde{x}_{\mathrm{pa}(r)} x ~ pa ( r ) in order to trace a counterfactual response curve, the draws of ( f F , f ~ ) (f^F,\tilde f) ( f F , f ~ ) 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 O ( M − 1 / 2 ) O(M^{-1/2}) O ( M − 1/2 ) .
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 λ ∈ R \lambda\in\mathbb{R} λ ∈ R , m ∈ R m\in\mathbb{R} m ∈ R and s 2 > 0 s^2>0 s 2 > 0 ,
∫ R Φ ( λ f ) N ( f ; m , s 2 ) d f = Φ ( λ m 1 + λ 2 s 2 ) . (49) \int_{\mathbb{R}}\Phi(\lambda f)\mathcal{N}(f;m,s^2)\,df=\Phi\left(\frac{\lambda m}{\sqrt{1+\lambda^2s^2}}\right). \tag*{(49)} ∫ R Φ ( λ f ) N ( f ; m , s 2 ) df = Φ ( 1 + λ 2 s 2 λm ) . (49)
Proof. Let Z ∼ N ( 0 , 1 ) Z\sim\mathcal{N}(0,1) Z ∼ N ( 0 , 1 ) be independent of F ∼ N ( m , s 2 ) F\sim\mathcal{N}(m,s^2) F ∼ N ( m , s 2 ) . Since Φ ( λ f ) = P ( Z ≤ λ f ) \Phi(\lambda f)=P(Z\le\lambda f) Φ ( λ f ) = P ( Z ≤ λ f ) , conditioning on F F F and applying the tower rule gives
∫ R Φ ( λ f ) N ( f ; m , s 2 ) d f = E F [ P ( Z ≤ λ F ∣ F ) ] = P ( Z − λ F ≤ 0 ) . (50) \int_{\mathbb{R}}\Phi(\lambda f)\mathcal{N}(f;m,s^2)\,df=\mathbb{E}_F\left[P(Z\le\lambda F\mid F)\right]=P(Z-\lambda F\le0). \tag*{(50)} ∫ R Φ ( λ f ) N ( f ; m , s 2 ) df = E F [ P ( Z ≤ λ F ∣ F ) ] = P ( Z − λ F ≤ 0 ) . (50)
By independence, Z − λ F ∼ N ( − λ m , 1 + λ 2 s 2 ) Z-\lambda F\sim\mathcal{N}(-\lambda m,1+\lambda^2s^2) Z − λ F ∼ N ( − λm , 1 + λ 2 s 2 ) , so the right-hand side of equation 50 equals Φ ( λ m / 1 + λ 2 s 2 ) \Phi(\lambda m/\sqrt{1+\lambda^2s^2}) Φ ( λm / 1 + λ 2 s 2 ) .
Remark 4 (Where the probit approximation may and may not be used). Lemma 4 with λ = π / 8 \lambda=\sqrt{\pi/8} λ = π /8 — the scale matching Φ ( λ ⋅ ) \Phi(\lambda\cdot) Φ ( λ ⋅ ) to σ \sigma σ to first order at the origin, since σ ′ ( 0 ) = 1 4 = λ φ ( 0 ) = λ / 2 π \sigma'(0)=\frac{1}{4}=\lambda\varphi(0)=\lambda/\sqrt{2\pi} σ ′ ( 0 ) = 4 1 = λ φ ( 0 ) = λ / 2 π [10 , 1 ] — yields the familiar closed form E [ σ ( f ) ] ≈ Φ ( λ m 1 + λ 2 s 2 ) \mathbb{E}[\sigma(f)]\approx\Phi\left(\frac{\lambda m}{\sqrt{1+\lambda^2s^2}}\right) E [ σ ( f )] ≈ Φ ( 1 + λ 2 s 2 λm ) for the interventional class probability itself — the quantity obtained by evaluating the fitted mechanism at x ~ p a ( r ) \tilde{\mathbf{x}}_{\mathrm{pa}(r)} x ~ pa ( r ) and averaging over the latent posterior. It does not give a closed form for equation (11) . The reason is that equations (47) –(48) are non-linear in the pair ( p F , p C F ) (p^{F},p^{\mathrm{CF}}) ( p F , p CF ) through min \min min , max \max 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 p F p^{F} p F and p C F p^{\mathrm{CF}} p CF and substituting the results into equation (10) computes g ( E [ p F ] , E [ p C F ] ) g(\mathbb{E}[p^{F}],\mathbb{E}[p^{\mathrm{CF}}]) g ( E [ p F ] , E [ p CF ]) in place of E [ g ( p F , p C F ) ] \mathbb{E}[g(p^{F},p^{\mathrm{CF}})] E [ g ( p F , p CF )] , 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 p C F = p F p^{\mathrm{CF}}=p^{F} p CF = p F pathwise. We therefore retain the Monte Carlo form in equation (11) . Where differentiability of the estimator is required, the reparameterised draws of ( f F , f ~ ) (f^{F},\tilde{f}) ( f F , f ~ ) are themselves differentiable in x ~ p a ( r ) \tilde{\mathbf{x}}_{\mathrm{pa}(r)} x ~ pa ( r ) , so pathwise gradients are available without the probit step.
Proof of the ordinal-GP counterfactual proposition
Numbering. This subsection proves Proposition 2. Equation (12) is the cutpoint reparameterisation, equation (13) the ordinal structural equation, equation (14) the compatibility identity, equation (15) the abduction of N r N_r N r , equation (16) the prediction given the latent and θ \theta θ , and equation (17) the marginalisation over the joint posterior of ( f r , θ ) (f_r,\theta) ( f r , θ ) . Lemma 6, proved below alongside Lemma 5, supplies the Laplace-Gaussian posterior over θ \theta θ that this marginalisation draws from. Corollary 3 is proved at the end of this subsection.
Throughout, Φ , φ \Phi,\varphi Φ , φ denote the standard normal CDF and density. For a fixed realisation of θ \theta θ , write b 0 ( θ ) = − ∞ < b 1 ( θ ) < ⋯ < b C − 1 ( θ ) < b C ( θ ) = ∞ b_0(\theta)=-\infty<b_1(\theta)<\cdots<b_{C-1}(\theta)<b_C(\theta)=\infty b 0 ( θ ) = − ∞ < b 1 ( θ ) < ⋯ < b C − 1 ( θ ) < b C ( θ ) = ∞ for the cutpoints of equation (13) at that $\theta via equation (12) ; as elsewhere in this appendix, all statements are for a fixed r r r with the subscript suppressed.
Lemma 5 (Laplace approximation for the ordinal-probit likelihood [3 ] ). Fix a realisation of θ \theta θ and write b c : = b c ( θ ) b_c:=b_c(\theta) b c := b c ( θ ) . Let π ( f ; c ) : = Φ ( b c − f ) − Φ ( b c − 1 − f ) \pi(f;c):=\Phi(b_c-f)-\Phi(b_{c-1}-f) π ( f ; c ) := Φ ( b c − f ) − Φ ( b c − 1 − f ) be the likelihood of observing class c c c given latent value f f f , and let Ψ ( f ; θ ) : = ∑ i = 1 n log π ( f i ; x i r ) − 1 2 f T K − 1 f + c o n s t \Psi(f;\theta):=\sum_{i=1}^{n}\log\pi(f_i;x_i^r)-\frac{1}{2}f^{\mathsf{T}}K^{-1}f+\mathrm{const} Ψ ( f ; θ ) := ∑ i = 1 n log π ( f i ; x i r ) − 2 1 f T K − 1 f + const be the unnormalised log posterior of the single-latent GP-ordinal model equation (13) at that θ \theta θ . Because π ( ⋅ ; c ) \pi(\cdot;c) π ( ⋅ ; c ) is a function of f i f_i f i alone, ∇ f Ψ ( f ; θ ) = ℓ ′ ( f ; θ ) − K − 1 f \nabla_f\Psi(f;\theta)=\ell'(f;\theta)-K^{-1}f ∇ f Ψ ( f ; θ ) = ℓ ′ ( f ; θ ) − K − 1 f and ∇ f 2 Ψ ( f ; θ ) = − W ( f ; θ ) − K − 1 \nabla_f^2\Psi(f;\theta)=-W(f;\theta)-K^{-1} ∇ f 2 Ψ ( f ; θ ) = − W ( f ; θ ) − K − 1 with W ( f ; θ ) W(f;\theta) W ( f ; θ ) diagonal, W i i = − ℓ i ′ ′ ( f i ) W_{ii}=-\ell_i''(f_i) W ii = − ℓ i ′′ ( f i ) , where
ℓ i ′ ( f i ) = φ ( z i 0 ) − φ ( z i 1 ) π ( f i ; x i r ) , ℓ i ′ ′ ( f i ) = z i 0 φ ( z i 0 ) − z i 1 φ ( z i 1 ) π ( f i ; x i r ) − ( ℓ i ′ ( f i ) ) 2 (51) \ell_i'(f_i)=\frac{\varphi(z_i^0)-\varphi(z_i^1)}{\pi(f_i;x_i^r)},\qquad
\ell_i''(f_i)=\frac{z_i^0\varphi(z_i^0)-z_i^1\varphi(z_i^1)}{\pi(f_i;x_i^r)}-\left(\ell_i'(f_i)\right)^2 \tag*{(51)} ℓ i ′ ( f i ) = π ( f i ; x i r ) φ ( z i 0 ) − φ ( z i 1 ) , ℓ i ′′ ( f i ) = π ( f i ; x i r ) z i 0 φ ( z i 0 ) − z i 1 φ ( z i 1 ) − ( ℓ i ′ ( f i ) ) 2 (51) z i 1 : = b x i r − f i z_i^1:=b_{x_i^r}-f_i z i 1 := b x i r − f i , z i 0 : = b x i r − 1 − f i z_i^0:=b_{x_i^r-1}-f_i z i 0 := b x i r − 1 − f i (with φ ( ± ∞ ) : = 0 \varphi(\pm\infty):=0 φ ( ± ∞ ) := 0 , and z φ ( z ) → 0 z\varphi(z)\to0 z φ ( z ) → 0 as z → ± ∞ z\to\pm\infty z → ± ∞ ). Chu and Ghahramani [2005] give this construction — their Laplace approximation — together with a treatment of the resulting Newton iteration; where W ( f ^ ; θ ) ⪰ 0 W(\hat{f};\theta)\succeq0 W ( f ^ ; θ ) ⪰ 0 at the mode f ^ ( θ ) \hat{f}(\theta) f ^ ( θ ) (as it is for every fit reported in the validation section of the main text when W W W is evaluated numerically), the mode is characterised by f ^ ( θ ) = K ℓ ′ ( f ^ ( θ ) ; θ ) \hat{f}(\theta)=K\ell'(\hat{f}(\theta);\theta) f ^ ( θ ) = K ℓ ′ ( f ^ ( θ ) ; θ ) , the Laplace posterior is q ( f ∣ θ , ⋅ ) = N ( f ^ ( θ ) , ( K − 1 + W ^ ) − 1 ) q(f\mid\theta,\cdot)=\mathcal{N}\left(\hat{f}(\theta),(K^{-1}+\hat{W})^{-1}\right) q ( f ∣ θ , ⋅ ) = N ( f ^ ( θ ) , ( K − 1 + W ^ ) − 1 ) , and the induced predictive law at any two inputs x ⋆ , x † x^\star,x^\dagger x ⋆ , x † is jointly Gaussian with
E q [ f ( x ⋆ ) ∣ θ ] = k ⋆ T ℓ ′ ( f ^ ( θ ) ; θ ) , Cov q [ f ( x ⋆ ) , f ( x † ) ∣ θ ] = k ( x ⋆ , x † ) − k ⋆ T ( K + W ^ − 1 ) − 1 k † (52) \mathbb{E}_q[f(x^\star)\mid\theta]=k_\star^{\mathsf{T}}\ell'(\hat{f}(\theta);\theta),\qquad
\operatorname{Cov}_q[f(x^\star),f(x^\dagger)\mid\theta]=k(x^\star,x^\dagger)-k_\star^{\mathsf{T}}(K+\hat{W}^{-1})^{-1}k_\dagger \tag*{(52)} E q [ f ( x ⋆ ) ∣ θ ] = k ⋆ T ℓ ′ ( f ^ ( θ ) ; θ ) , Cov q [ f ( x ⋆ ) , f ( x † ) ∣ θ ] = k ( x ⋆ , x † ) − k ⋆ T ( K + W ^ − 1 ) − 1 k † (52) the single-latent specialisation of Lemma 1(iv) with the softmax likelihood’s ( e − π ^ ) (e-\hat{\pi}) ( e − π ^ ) and per-class W ^ c \hat{W}_c W ^ c replaced by ℓ ′ ( f ^ ( θ ) ; θ ) \ell'(\hat{f}(\theta);\theta) ℓ ′ ( f ^ ( θ ) ; θ ) and W ^ \hat{W} W ^ 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 θ \theta θ is fixed rather than random: the statement holds conditionally on any realisation of θ \theta θ , cutpoints b ( θ ) b(\theta) b ( θ ) 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 f ^ ( θ ) \hat{f}(\theta) f ^ ( θ ) and Ψ ( ⋅ ; θ ) \Psi(\cdot;\theta) Ψ ( ⋅ ; θ ) be as in Lemma 5, and let LML ( θ ) : = Ψ ( f ^ ( θ ) ; θ ) − 1 2 log det ( I + W ^ 1 / 2 K W ^ 1 / 2 ) \operatorname{LML}(\theta):=\Psi(\hat{f}(\theta);\theta)-\frac{1}{2}\log\det(I+\hat{W}^{1/2}K\hat{W}^{1/2}) LML ( θ ) := Ψ ( f ^ ( θ ) ; θ ) − 2 1 log det ( I + W ^ 1/2 K W ^ 1/2 ) denote the Laplace log marginal likelihood of Lemma 5
evaluated at θ \theta θ — the quantity Lemma 5’s Newton iteration already produces for any fixed θ \theta θ , since profiling out f f f requires no assumption on how θ \theta θ itself was chosen. Let
L ( θ ) : = log p ( θ ) + L M L ( θ ) , θ ^ : = arg max θ L ( θ ) . L(\theta) := \log p(\theta) + \mathrm{LML}(\theta), \qquad\hat{\theta} := \underset{\theta}{\arg\max}\ L(\theta). L ( θ ) := log p ( θ ) + LML ( θ ) , θ ^ := θ arg max L ( θ ) .
By the envelope theorem, since ∂ Ψ / ∂ f = 0 \partial\Psi/\partial f = 0 ∂ Ψ/ ∂ f = 0 at f = f ^ ( θ ) f = \hat{f}(\theta) f = f ^ ( θ ) for every θ \theta θ , the total derivative ∇ θ L ( θ ) \nabla_\theta L(\theta) ∇ θ L ( θ ) equals the partial derivative of log p ( θ ) + Ψ ( f ; θ ) \log p(\theta) + \Psi(f;\theta) log p ( θ ) + Ψ ( f ; θ ) in θ \theta θ holding f = f ^ ( θ ) f = \hat{f}(\theta) f = f ^ ( θ ) fixed: the gradient of the profiled objective sees θ \theta θ only through the explicit appearance of b ( θ ) b(\theta) b ( θ ) in the per-point likelihoods, with no term from d f ^ / d θ d\hat{f}/d\theta d f ^ / d θ . The Hessian does not enjoy this simplification: differentiating the stationarity condition f ^ ( θ ) = K ℓ ′ ( f ^ ( θ ) ; θ ) \hat{f}(\theta) = K\ell'(\hat{f}(\theta);\theta) f ^ ( θ ) = K ℓ ′ ( f ^ ( θ ) ; θ ) implicitly gives
d f ^ d θ = ( K − 1 + W ^ ) − 1 K ∂ ℓ ′ ∂ θ ∣ f ^ ( θ ) . \frac{d\hat{f}}{d\theta} = \left(\mathbf{K}^{-1} + \hat{\mathbf{W}}\right)^{-1}\mathbf{K}\left.\frac{\partial\ell'}{\partial\theta}\right|_{\hat{f}(\theta)}. d θ d f ^ = ( K − 1 + W ^ ) − 1 K ∂ θ ∂ ℓ ′ f ^ ( θ ) .
the single-latent analogue of the implicit-function step used to differentiate a GP’s marginal likelihood with respect to its kernel hyperparameters [19 §5.5.1] , and ∇ θ 2 L ( θ ) \nabla_\theta^2L(\theta) ∇ θ 2 L ( θ ) carries a corresponding correction term through this Jacobian. The Laplace approximation to the profiled cutpoint posterior is then
θ ∣ D ≈ N ( θ ^ , Σ θ ) , Σ θ = − [ ∇ θ 2 L ( θ ) ] θ = θ ^ − 1 . (53) \theta\mid\mathcal{D} \approx\mathcal{N}(\hat{\theta},\Sigma_\theta), \qquad\Sigma_\theta= -\left[\nabla_\theta^2L(\theta)\right]_{\theta=\hat{\theta}}^{-1}. \tag*{(53)} θ ∣ D ≈ N ( θ ^ , Σ θ ) , Σ θ = − [ ∇ θ 2 L ( θ ) ] θ = θ ^ − 1 . (53)
Remark 5 (Numerical versus symbolic Hessian). The correction term in ∇ θ 2 L \nabla_\theta^2L ∇ θ 2 L above is exact but need not be coded symbolically: since θ ∈ R C − 1 \theta\in\mathbb{R}^{C-1} θ ∈ R C − 1 is low-dimensional throughout this paper’s experiments (C ≤ 3 C \le3 C ≤ 3 ), Σ θ \Sigma_\theta Σ θ in equation (53) is instead obtained by numerically differentiating L ( θ ) L(\theta) L ( θ ) (central finite differences), which is the same quantity up to O ( ϵ 2 ) O(\epsilon^2) O ( ϵ 2 ) truncation error and avoids re-deriving and re-implementing d f ^ / d θ d\hat{f}/d\theta d f ^ / d θ in code.
Proof of the ordinal proposition. Compatibility. Fix any realisation of θ \theta θ and write b c : = b c ( θ ) b_c := b_c(\theta) b c := b c ( θ ) . Since N r ∼ N ( 0 , 1 ) N_r \sim\mathcal{N}(0,1) N r ∼ N ( 0 , 1 ) is independent of ( f r , θ ) (f_r,\theta) ( f r , θ ) by construction of equation (13) , Y r ∣ f r ( x ) , θ ∼ N ( f r ( x ) , 1 ) Y_r \mid f_r(x),\theta\sim\mathcal{N}(f_r(x),1) Y r ∣ f r ( x ) , θ ∼ N ( f r ( x ) , 1 ) , and X r = c X_r = c X r = c iff Y r ∈ [ b c − 1 , b c ) Y_r \in[b_{c-1},b_c) Y r ∈ [ b c − 1 , b c ) . Hence P ( X r = c ∣ X p a ( r ) = x , f r , θ ) = Φ ( b c − f r ( x ) ) − Φ ( b c − 1 − f r ( x ) ) P(X_r = c \mid X_{\mathrm{pa}(r)} = x,f_r,\theta) = \Phi(b_c - f_r(x)) - \Phi(b_{c-1} - f_r(x)) P ( X r = c ∣ X pa ( r ) = x , f r , θ ) = Φ ( b c − f r ( x )) − Φ ( b c − 1 − f r ( x )) , which is equation (14) ; this is the defining likelihood of Lemma 5 at that θ \theta θ , so no additional argument is needed. As N r N_r N r is exogenous and independent of everything upstream, the same identity evaluated at x ~ p a ( r ) \widetilde{x}_{\mathrm{pa}(r)} x pa ( r ) is the interventional law, so equation (13) is compatible with any fitted f r f_r f r exactly as Proposition 1 is compatible with any fitted p \mathbf{p} p : nothing about Φ \Phi Φ 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 θ \theta θ ’s non-randomness – averaging equation (14) over the joint posterior of ( f r , θ ) (f_r,\theta) ( f r , θ ) still reproduces the fitted model’s own law by the tower rule.
Abduction. Fix any realisation of θ \theta θ and write c ∗ : = x r F c^* := x_r^F c ∗ := x r F , ( a F , b F ) : = ( b c ∗ − 1 ( θ ) , b c ∗ ( θ ) ) (a^F,b^F) := (b_{c^*-1}(\theta),b_{c^*}(\theta)) ( a F , b F ) := ( b c ∗ − 1 ( θ ) , b c ∗ ( θ )) , and condition on f r F : = f r ( x p a ( r ) F ) f_r^F := f_r(x_{\mathrm{pa}(r)}^F) f r F := f r ( x pa ( r ) F ) . The event X r F = c ∗ X_r^F = c^* X r F = c ∗ is, given f r F f_r^F f r F and θ \theta θ , exactly { N r ∈ ( ( a F − f r F , b F − f r F ) ) } \{N_r \in((a^F-f_r^F,b^F-f_r^F))\} { N r ∈ (( a F − f r F , b F − f r F ))} , since Y r F = f r F + N r Y_r^F = f_r^F + N_r Y r F = f r F + N r . Because N r N_r N r is a priori N ( 0 , 1 ) \mathcal{N}(0,1) N ( 0 , 1 ) and independent of ( f r , θ ) (f_r,\theta) ( f r , θ ) , and the only information the conditioning event carries about N r N_r N r is that it lies in this interval, Bayes’ rule gives the posterior of N r N_r N r 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 θ \theta θ : no approximation intervenes between the observation and the posterior of the exogenous variable at a given θ \theta θ , 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 θ \theta θ itself is not known, the noise’s actual posterior is obtained by the tower rule, averaging equation (15) over the joint posterior of ( f r F , θ ) (f_r^F,\theta) ( f r F , θ ) given the data and the factual observation – a continuous mixture of truncated normals rather than a single one, since different θ \theta θ draws truncate to different intervals.
Action and prediction. Fix any realisation of θ \theta θ . The intervention replaces x p a ( r ) F x_{\mathrm{pa}(r)}^F x pa ( r ) F by x ~ p a ( r ) \widetilde{x}_{\mathrm{pa}(r)} x pa ( r ) and leaves f r f_r f r , θ \theta θ , and N r N_r N r untouched, so with f ~ r : = f r ( x ~ p a ( r ) ) \widetilde{f}_r := f_r(\widetilde{x}_{\mathrm{pa}(r)}) f r := f r ( x pa ( r ) ) the counterfactual latent is Y ~ r = f ~ r + N r \widetilde{Y}_r = \widetilde{f}_r+N_r Y r = f r + N r , the same N r N_r N r as abducted in equation (15) . Writing γ k : = b k ( θ ) − f ~ r \gamma_k := b_k(\theta)-\widetilde{f}_r γ k := b k ( θ ) − f r , { X r C F = k } = { Y ~ r ∈ [ b k − 1 ( θ ) , b k ( θ ) ) } = { N r ∈ ( γ k − 1 , γ k ) } \{X_r^{\mathrm{CF}}=k\} = \{\widetilde{Y}_r \in[b_{k-1}(\theta),b_k(\theta))\} = \{N_r \in(\gamma_{k-1},\gamma_k)\} { X r CF = k } = { Y r ∈ [ b k − 1 ( θ ) , b k ( θ ))} = { N r ∈ ( γ k − 1 , γ k )} , so with α : = a F − f r F \alpha:= a^F-f_r^F α := a F − f r F , β : = b F − f r F \beta:= b^F-f_r^F β := b F − f r F ,
P ( X r C F = k ∣ X F , f r F , f ~ r , θ ) = P ( N r ∈ ( γ k − 1 , γ k ) ∣ N r ∈ ( α , β ) ) = ∣ ( γ k − 1 , γ k ) ∩ ( α , β ) ∣ N ( 0 , 1 ) ∣ ( α , β ) ∣ N ( 0 , 1 ) . (54) P(X_r^{\mathrm{CF}}=k \mid X^F,f_r^F,\widetilde{f}_r,\theta) = P(N_r \in(\gamma_{k-1},\gamma_k) \mid N_r \in(\alpha,\beta)) = \frac{\left|(\gamma_{k-1},\gamma_k)\cap(\alpha,\beta)\right|_{\mathcal{N}(0,1)}}{\left|(\alpha,\beta)\right|_{\mathcal{N}(0,1)}}. \tag*{(54)} P ( X r CF = k ∣ X F , f r F , f r , θ ) = P ( N r ∈ ( γ k − 1 , γ k ) ∣ N r ∈ ( α , β )) = ∣ ( α , β ) ∣ N ( 0 , 1 ) ∣ ( γ k − 1 , γ k ) ∩ ( α , β ) ∣ N ( 0 , 1 ) . (54)
which, writing the intersection’s endpoints as max ( α , γ k − 1 ) \max(\alpha,\gamma_{k-1}) max ( α , γ k − 1 ) and min ( β , γ k ) \min(\beta,\gamma_k) min ( β , γ k ) and clipping a possibly empty intersection to probability zero via ( ⋅ ) + (\cdot)_+ ( ⋅ ) + , 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 θ \theta θ exactly the fixed-cutpoint computation. Since f r f_r f r is not known but only its Laplace posterior given θ \theta θ is (Lemma 5), the pair ( f r F , f ~ r ) (f_r^F,\tilde{f}_r) ( f r F , f ~ r ) must be drawn from that joint posterior and the indicator averaged over it. And since θ \theta θ is not known either, only its Laplace-Gaussian posterior equation 53 (Lemma 6) is, θ \theta θ itself must be drawn and the whole construction – refit ( f r F , f ~ r ) (f_r^F,\tilde{f}_r) ( f r F , f ~ r ) ’s joint posterior at the resulting b ( θ ) \mathbf{b}(\theta) b ( θ ) , 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 θ ( s ) \theta^{(s)} θ ( s ) the inner average over ( f r F , f ~ r ) (f_r^F,\tilde{f}_r) ( f r F , f ~ r ) is bounded with every draw contributing a vertex of the simplex, so the inner running average is itself a bounded, unbiased estimate of E ( f r F , f ~ r ) ∣ θ ( s ) [ equation 16 ] \mathbb{E}_{(f_r^F,\tilde{f}_r)\mid\theta^{(s)}}[\text{equation 16}] E ( f r F , f ~ r ) ∣ θ ( s ) [ equation 16 ] for every s s s ; averaging these in turn over θ ( s ) ∼ N ( θ ^ , Σ θ ) \theta^{(s)} \sim\mathcal{N}(\hat{\theta},\Sigma_\theta) θ ( s ) ∼ N ( θ ^ , Σ θ ) 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 θ \theta θ . Setting x ~ p a ( r ) = x p a ( r ) F \tilde{x}_{\mathrm{pa}(r)}=x_{\mathrm{pa}(r)}^F x ~ pa ( r ) = x pa ( r ) F gives f ~ r = f r F \tilde{f}_r=f_r^F f ~ r = f r F a.s. by the same joint-posterior-on-the-diagonal argument as Corollary 1’s proof, hence γ k = b k ( θ ) − f r F \gamma_k=b_k(\theta)-f_r^F γ k = b k ( θ ) − f r F for every k k k ; taking k = c ∗ k=c^* k = c ∗ gives ( γ c ∗ − 1 , γ c ∗ ) = ( α , β ) (\gamma_{c^*-1},\gamma_{c^*})=(\alpha,\beta) ( γ c ∗ − 1 , γ c ∗ ) = ( α , β ) , so the interval in the numerator of equation 16 contains ( α , β ) (\alpha,\beta) ( α , β ) and the ratio in equation 16 equals 1, while for k ≠ c ∗ k\ne c^* k = c ∗ the intervals ( γ k − 1 , γ k ) (\gamma_{k-1},\gamma_k) ( γ k − 1 , γ k ) and ( α , β ) (\alpha,\beta) ( α , β ) are disjoint (the γ \gamma γ ’s partition the real line the same way the factual class’s own interval does). Hence d o ( X p a ( r ) = x p a ( r ) F ) do(\mathbf{X}_{\mathrm{pa}(r)}=\mathbf{x}_{\mathrm{pa}(r)}^F) d o ( X pa ( r ) = x pa ( r ) F ) returns the point mass at c ∗ = x r F c^*=x_r^F c ∗ = x r F for every realisation of θ \theta θ , and equation 17 inherits this since it is a convex combination, over both θ \theta θ and the inner posterior draws, of point masses at c ∗ c^* c ∗ .
Corollary 3. If p ( θ ) = δ θ 0 p(\theta)=\delta_{\theta_0} p ( θ ) = δ θ 0 , then θ ^ = θ 0 \hat{\theta}=\theta_0 θ ^ = θ 0 and Σ θ = 0 \Sigma_\theta=0 Σ θ = 0 maximise and (degenerately) characterise the posterior equation 53 exactly, so every draw θ ( s ) = θ 0 \theta^{(s)}=\theta_0 θ ( s ) = θ 0 in equation 17: the outer expectation over θ \theta θ collapses to evaluation at the single point θ 0 \theta_0 θ 0 , and the nested estimator of the Action-and-prediction paragraph above reduces to a single Laplace fit of f r f_r f r at the fixed cutpoints b ( θ 0 ) \mathbf{b}(\theta_0) b ( θ 0 ) followed by the ordinary Monte Carlo average over ( f r F , f ~ r ) (f_r^F,\tilde{f}_r) ( f r F , f ~ r ) – exactly Chu and Ghahramani’s construction [3 ] , used throughout this paper prior to this section.