SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Cagliar Hizh*
Dept. of Computer Science Aalto University
Anne Juuti
Helsinki University Hospital and University of Helsinki
Tuure Saarinen
Kirsi Pietiläinen
Pekka Marttinen
Deciding on an appropriate intervention requires a causal model of a treatment, the outcome, and potential mediators. Causal mediation analysis lets us distinguish between direct and indirect effects of the intervention, but has mostly been studied in a static setting. In healthcare, data come in the form of complex, irregularly sampled time-series, with dynamic interdependencies between a treatment, outcomes, and mediators across time. Existing approaches to dynamic causal mediation analysis are limited to regular measurement intervals, simple parametric models, and disregard long-range mediator-outcome interactions. To address these limitations, we propose a non-parametric mediator-outcome model where the mediator is assumed to be a temporal point process that interacts with the outcome process. With this model, we estimate the direct and indirect effects of an external intervention on the outcome, showing how each of these affects the whole future trajectory. We demonstrate on semi-synthetic data that our method can accurately estimate direct and indirect effects. On real-world healthcare data, our model infers clinically meaningful direct and indirect effect trajectories for blood glucose after a surgery.
In healthcare, a key challenge is to design interventions that effectively control a target outcome [Vamathevan et al., 2019, Ghassemi et al., 2020]. To design an efficient intervention, decision-makers need not only to estimate the total effect of the intervention, but also understand the underlying causal mechanisms driving this effect. To this end, causal mediation analysis decomposes the total effect into: (i) an indirect effect flowing through an intermediate variable (mediator), and (ii) a direct effect representing the rest of the effect. The statistical question is then to estimate the direct and indirect effects.
As a running example, we consider the effect of bariatric surgery (treatment) on meal-blood glucose (mediator-outcome) dynamics. In Fig. 1, we show how blood glucose changes after the surgery. This change is partly mediated by the changes in diet before and after the surgery (alterations in meal size and frequency). However, the surgery can also directly impact blood glucose levels (via metabolic processes, regardless of meal size). To efficiently control glucose, we need to estimate to what extent the effect of surgery is due to the post-surgery diet (indirect) or other metabolic processes (direct).
Causal mediation has been studied extensively in a static setting with three variables: a treatment  $A$ , a mediator  $M$ , and an outcome  $Y$  [Robins and Greenland, 1992, Pearl, 2001, Robins, 2003, VanderWeele, 2009, Imai et al., 2010a,b, Tchetgen and Shpitser, 2012]. However, as the running example
*Correspondence: caglar.hizli@aalto.fi
Figure 1: Comparison of the meal-blood glucose dynamics of one patient for the pre- and post-surgery periods: meals (carbohydrate intake, cyan bars), glucose (black crosses), predicted glucose baseline  $\mathbf{f}_{\mathbf{b}}$  (red dashed line) and predicted glucose progression f (blue dashed line). For blood glucose, we see, after the surgery, (i) the baseline  $\mathbf{f}_{\mathbf{b}}$  declines (red dashed line, pre-surgery  $\rightarrow$  post-surgery), and (ii) the glucose response of a meal has a steeper rise and a steeper decline (blue peaks, pre-surgery  $\rightarrow$  post-surgery). For meals, we see, after the surgery, the patient eats (i) more frequently and (ii) less carbohydrates (cyan bars, pre-surgery  $\rightarrow$  post-surgery). A relevant research question is: how much of the surgery effect is due to the post-surgery diet (indirect) or other biological processes (direct)?
illustrates, many real-world healthcare problems are dynamic, i.e., the variables evolve over time and are measured at multiple time points, e.g., a patient's state observed through electronic health records (EHR) [Saeed et al., 2011, Soleimani et al., 2017, Schulam and Saria, 2017], tumour growth under chemotherapy and radiotherapy [Geng et al., 2017, Bica et al., 2020, Seedat et al., 2022], and continuous monitoring of blood glucose under meal and insulin events [Berry et al., 2020, Wyatt et al., 2021, Hizli et al., 2023]. Hence, instead of observing a single mediator and a single outcome after an intervention, in many situations the intervention is followed by (i) sequences of mediators and outcomes that vary over time. To complicate the matters further, these sequences may be complex, e.g., (ii) sparse and irregularly-sampled, as in EHR, or (iii) with long-range mediator-outcome dependencies.
Some existing works have addressed dynamic causal mediation for  $(i)$  a sequence of mediators and outcomes [VanderWeele and Tchetgen Tchetgen, 2017, Lin et al., 2017, Zheng and van der Laan, 2017, Vansteelandt et al., 2019, Aalen et al., 2020]; however, they are limited to measurements at regular time intervals. Furthermore, they are based on the parametric g-formula [Robins, 1986] and marginal structural models [Robins et al., 2000a], which can handle time-varying confounding but rely on simple linear models. A recent work by Zeng et al. [2021] (Fig. 2a) studied causal mediation for  $(ii)$  sparse and irregular longitudinal data, but considered neither  $(iii)$  long-range mediator-outcome dependencies nor the interaction between past outcomes and future mediators  $(\cdot \cdot \cdot \cdot ,$  Fig. 2c).
We address these limitations in dynamic causal mediation by introducing a method where both the mediator as well as the outcome are stochastic processes (as opposed to single variables in the static case). In this setup, we provide the estimated direct and indirect effects as longitudinal counterfactual trajectories, and theoretically, we present causal assumptions required to identify them. We model the mediator sequence as a marked point process (MPP), and the outcome sequence as a continuous-valued stochastic process, building on a non-parametric model [Hizli et al., 2023]. This allows for irregularly-sampled measurements of mediator and outcome processes, while capturing non-linear, long-range interactions between them. Recently, a different line of research investigated causal inference for MPPs [Gao et al., 2021, Zhang et al., 2022, Noorbakhsh and Rodriguez, 2022], but they have not considered a causal mediation setting. Compared to the existing literature [Hizli et al., 2023], our model enables the estimation of the direct and indirect effects separately by incorporating an external intervention that jointly affects both mediator and outcome processes (Fig. 2b vs. Fig. 2c).
- Dynamic causal mediation with a point process mediator. We generalize the dynamic causal mediation problem by modeling the mediator as a point process, which can have a ran-
(a) Direct and indirect effects with non-interacting longitudinal mediators [Zeng et al., 2021].
(b) Fully-mediated policy effect with interacting point process mediators [Hizli et al., 2023].
Figure 2: Comparison of available implementations for dynamic causal mediation. (a) Zeng et al. [2021] studied dynamic causal mediation for a sparse and irregularly-sampled mediator-outcome sequence; their counterfactual formulation allows for only uni-directional effects from mediator to outcome  $(\cdots \gg)$ , while their implementation assumes the effects are instantaneous. (b) Hizli et al. [2023] considered the long-range interaction between mediator and outcome processes  $(\cdots \gg +\cdots \gg)$ , but did not allow the intervention to directly affect the outcome. (c) While capturing long-range dependencies, our work allows for an intervention that affects both processes jointly  $(- \rightarrow)$ .
(c) Direct and indirect effects with interacting point process mediators (Our work).
dom number of occurrences at random times and complex interactions with the outcome. Furthermore, we provide causal assumptions required to identify the direct and indirect effects.
- A mediator-outcome model with an external intervention. We extend a previous non-parametric model for mediators and outcomes [Hizli et al., 2023] to include an external intervention that affects the joint dynamics of these two processes.
- In a real-world experiment, we study in a data-driven manner the effect of bariatric surgery for treatment of obesity on blood glucose dynamics, and separately estimate the direct effect from the indirect effect whereby surgery affects blood glucose through changed diet.
2 Dynamic Causal Mediation
In this section, we formulate the dynamic causal mediation problem for a treatment process  $A$ , a mediator process  $M$  and an outcome process  $Y$ , and contrast this with the static causal mediation definition for single variables  $A$ ,  $M$  and  $Y$ . Our formulation builds on structural causal models [SCM, Pearl, 2009] and an interventionist approach to causal mediation [Robins et al., 2022].
Structural Causal Model. An SCM  $\mathcal{M} = (\mathbf{S}, p(\mathbf{U}))$  of a set of variables  $\mathbf{X} = \{X_k\}_{k=1}^K$  is defined as a pair of (i) structural equations  $\mathbf{S} = \{X_k := f_k(\mathrm{pa}(X_k), U_k)\}_{k=1}^K$  and (ii) a noise distribution  $\mathbf{U} = \{U_k\}_{k=1}^K \sim p(\mathbf{U})$  [Pearl, 2009, Peters et al., 2017]. The SCM entails an observational distribution  $\mathbf{X} \sim p(\mathbf{X})$ . To see this, consider sampling noise  $\mathbf{U} \sim p(\mathbf{U})$  and then performing a forward pass through the structural equations  $\mathbf{S}$ . In the SCM, an intervention  $\mathrm{do}(X_k = \tilde{x}_k)$  is defined as an operation that removes the structural equation  $f_k(\cdot, \cdot)$  corresponding to  $X_k$  and sets  $X_k$  to the value  $\tilde{x}_k$ , yielding an interventional distribution  $p(\mathbf{X} | \mathrm{do}(X_k = \tilde{x}_k))$ .
Interventionist Approach to Causal Mediation. Consider an SCM of a treatment  $A$ , a mediator  $M$  and an outcome  $Y$  (Fig. 3a). For brevity, we focus on the indirect path, but the same reasoning applies for the direct path. To estimate the
indirect effect, we want to intervene only on the indirect path  $(A\rightarrow M\rightarrow Y)$ , while keeping the direct path  $(A\rightarrow Y)$  at its natural value. To achieve this, we follow an interventionist approach [Robins et al., 2022]. We hypothetically duplicate the treatment  $A$  into an indirect-path treatment  $A_{\rightarrow M}$  and a direct-path treatment  $A_{\rightarrow Y}$ , so that each of these affects only its target path (Fig. 3b). For instance, in the surgery-diet-glucose example (treatment-mediator-outcome), the indirect-path treatment
(a) Classical.
Figure 3: Graphical models for causal mediation. Mediation is defined in (a) using nested counterfactuals, while in (b) using path-specific treatments  $A_{\rightarrow M}$  and  $A_{\rightarrow Y}$ .
(b) Interventionist.
$A_{\rightarrow M}$  corresponds to changing only the diet, without changing how the surgery affects blood glucose through other metabolic processes. Using path-specific interventions, we follow Pearl [2001] and define the natural indirect effect (NIE) as
$$
\mathrm {N I E} (\tilde {a}) \equiv Y [ A _ {\rightarrow Y} = \varnothing , A _ {\rightarrow M} = \tilde {a} ] - Y [ A _ {\rightarrow Y} = \varnothing , A _ {\rightarrow M} = \varnothing ] \equiv Y [ \varnothing , \tilde {a} ] - Y [ \varnothing , \varnothing ], \tag {1}
$$
where we use the short-hand notation for an intervention  $[\tilde{a}_1, \tilde{a}_2] \equiv \mathrm{do}(A_{\rightarrow Y} = \tilde{a}_1, A_{\rightarrow M} = \tilde{a}_2)$ , and  $Y[\tilde{a}_1, \tilde{a}_2]$  is the potential outcome after setting the direct-path treatment (first argument) to  $\tilde{a}_1$  and the indirect-path treatment to  $\tilde{a}_2$ . The value  $\varnothing$  means that the corresponding pathwise treatment is set to its natural value, i.e., the value the variable would have attained without our doing any intervention. Hence, the indirect effect is intuitively defined in Eq. (1) as the difference of the outcome  $Y$  when the direct-path treatment is fixed to  $\varnothing$  while the indirect-path treatment is either  $\tilde{a}$  or  $\varnothing$ .
The natural direct effect (NDE) is similarly defined as [Pearl, 2001, Robins et al., 2022]
$$
\mathrm {N D E} (\tilde {a}) \equiv Y [ A _ {\rightarrow Y} = \tilde {a}, A _ {\rightarrow M} = \tilde {a} ] - Y [ A _ {\rightarrow Y} = \varnothing , A _ {\rightarrow M} = \tilde {a} ] \equiv Y [ \tilde {a}, \tilde {a} ] - Y [ \varnothing , \tilde {a} ], \tag {2}
$$
However, these definitions are limited to the static case with single variables  $A$ ,  $M$  and  $Y$ . Hence, they are not applicable as such to complex, real-world dynamics of healthcare data sets, where a treatment is typically followed by sequences of irregularly-sampled mediator and outcome measurements.
2.1 Direct and Indirect Effects as Stochastic Processes
We extend the static definitions of natural direct and indirect effects by formulating them as stochastic processes. In the following, we assume a single patient is observed over a period  $[0,T]$ . The formulation trivially generalizes to multiple patients, assuming exchangeability.
For each patient, we define a mediator process  $M$  and an outcome process  $\mathbf{Y}$ . We assume the treatment  $A$  represents a single intervention occurring once at time  $t_a\in [0,T]$ , e.g., a surgery. For completeness, we define also the treatment as a stochastic process  $A$  corresponding to a binary counting process  $N_{A}:[0,T]\to \{0,1\}$  that specifies the pre- and post-intervention periods. The treatment is applied to control an outcome of interest over time, e.g. continuously-monitored blood glucose, which is defined as the outcome process  $\mathbf{Y}:[0,T]\rightarrow \mathbb{R}$ . We assume the treatment affects the outcome process  $\mathbf{Y}$  via two separate causal paths, where the indirect path ( $\cdots$ ), Fig. 2c) that goes through mediators occurring at non-deterministic times, e.g., meals, is of special interest. Hence, we define this causal path explicitly through the mediator process  $M:[0,T]\to \mathbb{N}\times \{\mathbb{R}\cup \{\emptyset \}\}$ , such that  $M(\tau) = (k,m)$ , where  $k$  is the number of occurrences of the mediating event up until time  $\tau$  and  $m$  is the value of the mediator at time  $\tau$ . Occurrences  $k$  follow a counting process  $N_{M}:[0,T]\to \mathbb{N}$  and values  $m$  follow a dosage process  $D_M:[0,T]\to \{\mathbb{R}\cup \{\emptyset \}\}$ , such that these two processes contain all the information about the mediator process on the period  $[0,T]$ . At occurrence times, the mediator gets a value  $m\in \mathbb{R}$  and at other times  $m = \emptyset$ . The rest of the possible causal paths are not modeled explicitly but instead their effect is jointly represented as the direct path  $A\to Y$  ( $\cdots$ ), Fig. 2c).
We define direct and indirect treatment effects formally analogously to the static case, and assume that the treatment process  $A(\tau)$  is hypothetically duplicated into the direct-path treatment  $A_{\rightarrow Y}(\tau)$  and the indirect-path treatment  $A_{\rightarrow M}(\tau)$  [Robins and Richardson, 2010, Didelez, 2019]. The indirect-path treatment  $A_{\rightarrow M}(\tau)$  affects the outcome only through the mediator process  $M$ . Similarly, the direct-path treatment  $A_{\rightarrow Y}(\tau)$  affects the outcome through processes other than the mediator.
In practice, we assume that we observe the mediator process  $M$  at  $I$  time points:  $\{(t_i, m_i)\}_{i=1}^I$ , where  $t_i$  is the occurrence time of the  $i^{\text{th}}$  mediator event and  $m_i$  the corresponding value. Similarly, we observe the outcome process  $\mathbf{Y}$  as  $\{(t_j, y_j)\}_{j=1}^J$ . We observe  $\mathbf{A}(\tau)$  as the occurrence of a single treatment event at time  $t_a \in [0, T]$ . In the 'factual' world, treatments  $A$ ,  $A \to Y$  and  $A \to M$  occur at the same time, i.e., their respective counting processes coincide:
$$
\boldsymbol {N} _ {A} (\tau) = \boldsymbol {N} _ {A \rightarrow Y} (\tau) = \boldsymbol {N} _ {A \rightarrow M} (\tau) = \mathbb {1} \left\{\tau \geq t _ {a} \right\}. \tag {3}
$$
For instance, in the surgery-diet-blood glucose (treatment-mediator-outcome) example, the surgery starts to affect both the diet and the other metabolic processes immediately after it has occurred at time  $t_a$ . To measure how the surgery affects the blood glucose (indirectly) through diet or (directly) through other metabolic processes, we consider a hypothetical intervention that changes either the diet or the other metabolic processes, but not both at the same time. Formally, we devise these hypothetical interventions that activate only the direct or the indirect causal path by setting treatment times  $t_{A\to Y}$  and  $t_{A\to M}$  to distinct values.
Using these hypothetical interventions, we formulate two causal queries to understand how the treatment affects the outcome process via direct and indirect casual mechanisms. The natural indirect effect (NIE) is defined as
$$
\begin{array}{l} \mathrm {N I E} \left(\tilde {t} _ {a}\right) \equiv \mathbf {Y} _ {> \tilde {t} _ {a}} [ A _ {\rightarrow Y} = \varnothing , A _ {\rightarrow M} = \tilde {t} _ {a} ] - \mathbf {Y} _ {> \tilde {t} _ {a}} [ A _ {\rightarrow Y} = \varnothing , A _ {\rightarrow M} = \varnothing ] \\ \equiv \boldsymbol {Y} _ {> \tilde {t} _ {a}} [ \varnothing , \tilde {t} _ {a} ] - \boldsymbol {Y} _ {> \tilde {t} _ {a}} [ \varnothing , \varnothing ]. \tag {4} \\ \end{array}
$$
A close comparison with the static case in Eq. (1) reveals that the outcome is here defined as a stochastic process  $Y_{>\tilde{t}_a}$  which describes its entire future trajectory; i.e., a sample from this process corresponds to an entire sequence of values representing the continuation of the outcome after the intervention at time  $\tilde{t}_a$ . For example, Eq. (4) can quantify the contribution of the change of diet at time  $\tilde{t}_a$  on the blood glucose progression, while other metabolic processes are fixed at their natural state,  $\varnothing$ , before the surgery. Similarly, we estimate the natural direct effect (NDE) using
$$
\begin{array}{l} \mathrm {N D E} (\tilde {t} _ {a}) \equiv \boldsymbol {Y} _ {> \tilde {t} _ {a}} [ A _ {\rightarrow Y} = \tilde {t} _ {a}, A _ {\rightarrow M} = \tilde {t} _ {a} ] - \boldsymbol {Y} _ {> \tilde {t} _ {a}} [ A _ {\rightarrow Y} = \varnothing , A _ {\rightarrow M} = \tilde {t} _ {a} ] \\ \equiv \boldsymbol {Y} _ {> \tilde {t} _ {a}} [ \tilde {t} _ {a}, \tilde {t} _ {a} ] - \boldsymbol {Y} _ {> \tilde {t} _ {a}} [ \varnothing , \tilde {t} _ {a} ], \tag {5} \\ \end{array}
$$
which quantifies the contribution of the changes in other metabolic processes on the blood glucose progression, while the diet is fixed at its natural state after the surgery. The total effect of the intervention  $[t_a = \tilde{t}_a]$  is equal to the sum of the NDE and the NIE:
$$
\mathrm {T E} \left(\tilde {t} _ {a}\right) = \mathrm {N D E} \left(\tilde {t} _ {a}\right) + \mathrm {N I E} \left(\tilde {t} _ {a}\right) = \mathbf {Y} _ {\geqslant \tilde {t} _ {a}} \left[ \tilde {t} _ {a}, \tilde {t} _ {a} \right] - \mathbf {Y} _ {\geqslant \tilde {t} _ {a}} [ \varnothing , \varnothing ]. \tag {6}
$$
3 Causal Assumptions and Identifiability
In this section, we first develop a mathematical formulation of the causal assumptions required to identify direct and indirect effect trajectories  $\mathrm{NDE}(\tilde{t}_a)$  and  $\mathrm{NIE}(\tilde{t}_a)$ . Under these assumptions, we next represent the causal queries in the form of statistical terms, which we can estimate using a mediator-outcome model. The proofs and further details are presented in Appendix A.
To identify the direct, indirect and total effects, we make the following Assumptions (A1, A2, A3):
(A1):  $p(\cdot \mid \mathrm{do}(\pmb {A} = \tilde{\pmb{N}}_A))\equiv p(\cdot \mid \pmb {A} = \tilde{\pmb{N}}_A),$
(A2):  $A_{\rightarrow Y} \perp M(\tau) \mid A_{\rightarrow M}, \mathcal{H}_{< \tau}, \quad \tau \in [0, T]$ ,
(A3):  $A_{\rightarrow M} \perp Y(\tau) \mid A_{\rightarrow Y}, \mathcal{H}_{<\tau}, \quad \tau \in [0, T]$ ,
where  $\mathcal{H}_{<\tau}$  is the history up to time  $\tau$ , including both mediators and outcomes. (A1) is a continuous-time version of the No-Unobserved-Confounders assumption for process pairs  $(A, M)$  and  $(A, Y)$  [continuous-time NUC, Schulam and Saria, 2017]. (A2, A3) ensure that path-specific treatments  $A_{\rightarrow M}$  and  $A_{\rightarrow Y}$  causally affect only their target path, conditioned on the past. Accordingly, they imply no unobserved confounding between mediator and outcome processes  $(M, Y)$ . (A1, A2, A3) might not hold in observational studies and they are not statistically testable. We discuss their applicability in the running example in Section 5.1.
For the total effect, we need to estimate the trajectories  $\mathbf{Y}_{\geqslant \tilde{t}_a}[\tilde{t}_a,\tilde{t}_a]$  and  $\mathbf{Y}_{\geqslant \tilde{t}_a}[\varnothing ,\varnothing ]$ , which are identifiable under (A1). For direct and indirect effects, we further need to estimate the counterfactual trajectory  $\mathbf{Y}_{>\tilde{t}_a}[\varnothing ,\tilde{t}_a]$ , i.e., the outcome process under a hypothetical intervention, which is identifiable under (A1, A2, A3). We consider a counterfactual trajectory  $\mathbf{Y}_{>\tilde{t}_a}$  under a paired intervention, e.g.  $[\varnothing ,\tilde{t}_a]$ , at  $R$  ordered query points  $\mathbf{q} = \{q_r\}_{r = 1}^R$ ,  $q_{r} > \tilde{t}_{a}\colon \mathbf{Y}_{\mathbf{q}}[\varnothing ,\tilde{t}_{a}] = \{Y(q_{r})[\varnothing ,\tilde{t}_{a}]\}_{r = 1}^{R}$ . Provided that (A1, A2, A3) hold, the interventional distribution of the counterfactual trajectory  $\mathbf{Y}_{\mathbf{q}}[\varnothing ,\tilde{t}_a]$  is given by
$$
P \left(\mathbf {Y} _ {\mathbf {q}} [ \varnothing , \tilde {t} _ {a} ]\right) = \sum_ {M _ {> \bar {t} _ {a}}} \prod_ {r = 0} ^ {R - 1} \underbrace {P \left(Y _ {q _ {r + 1}} \mid M _ {\left[ q _ {r} , q _ {r + 1}\right)} , t _ {a} = \varnothing , \mathcal {H} _ {\leq q _ {r}}\right)} _ {\text {o u t c o m e t e r m} \bullet} \underbrace {P \left(M _ {\left[ q _ {r} , q _ {r + 1}\right)} \mid t _ {a} = \tilde {t} _ {a} , \mathcal {H} _ {\leq q _ {r}}\right)} _ {\text {m e d i a t o r t e r m} \circledast}, \tag {7}
$$
where  $M_{> \tilde{t}_a} = \cup_{r=0}^{R-1} M_{[q_r, q_{r+1})}$ . The two terms in Eq. (7) can be estimated by an interacting mediator-outcome model, discussed in Section 4. In addition, the definitions of the  $\mathrm{NIE}(\tilde{t}_a)$  and the  $\mathrm{NDE}(\tilde{t}_a)$  in Eqs. (4) and (5) under a single treatment at time  $\tilde{t}_a$  can be extended to direct and indirect effects under a sequence of healthcare interventions, if necessary. We further illustrate this extension in Appendix A.3 and provide an identifiability analysis in such multiple treatment setups.
4 Interacting Mediator-Outcome Model
To model the interacting mediator-outcome processes, we extend a non-parametric model for mediators and outcomes [Hizli et al., 2023] to include an external intervention  $A$  that affects the joint dynamics of these two processes. Similar, we combine a marked point process [MPP, Daley and Vere-Jones, 2003] and a conditional Gaussian process [GP, Williams and Rasmussen, 2006]. For background on MPP, GP, and details on model definitions, inference and scalability, see Appendix B.
Each patient is observed in two regimes:  $\mathcal{D} = \{\mathcal{D}^{(a)}\}_{a\in \{0,1\}}$ . Within each regime  $a\in \{0,1\}$ , the data set  $\mathcal{D}^{(a)}$  contains the measurements of mediator  $M$  and outcome  $Y$  at irregular times:  $\{(t_i^{(a)},m_i^{(a)})\}_{i = 1}^I^{(a)}$  and  $\{(t_j^{(a)},y_j^{(a)})\}_{j = 1}^{J^{(a)}}$ . For the full data set  $\mathcal{D}$ , the joint distribution is