SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Assumption A5: Local Independence of Mediator  $M$  and Direct-Path Treatment  $A_{\rightarrow Y}$ . Conditioned on the indirect-path treatment process  $A_{< \tau}^{\rightarrow M}$  and the history  $\mathcal{H}_{< \tau}$  of the mediator and outcome processes up until time  $\tau$ , the mediator process  $M$  is independent of the history of the direct-path treatment  $A_{< \tau}^{\rightarrow Y}$  locally at time  $\tau$ , for all times  $\tau \in [0, T]$ :
$$
\boldsymbol {A} _ {<   \tau} ^ {\rightarrow Y} \perp M (\tau) \mid \boldsymbol {A} _ {<   \tau} ^ {\rightarrow M}, \mathcal {H} _ {<   \tau}, \quad \tau \in [ 0, T ]. \tag {31}
$$
Assumption A6: Local Independence of Outcome  $Y$  and Indirect-Path Treatment  $A \rightarrow M$ . Conditioned on the indirect-path treatment process  $A_{<\tau}^{Y}$  and the history  $\mathcal{H}_{<\tau}$  of the mediator and outcome processes up until time  $\tau$ , the outcome process  $Y(\tau)$  is independent of the past of the indirect-path treatment  $A_{<\tau}^{M}$  locally at time  $\tau$ , for all time  $\tau \in [0, T]$ :
$$
\boldsymbol {A} _ {<   \tau} ^ {\rightarrow M} \perp Y (\tau) \mid \boldsymbol {A} _ {<   \tau} ^ {\rightarrow Y}, \mathcal {H} _ {<   \tau}, \quad \tau \in [ 0, T ]. \tag {32}
$$
Hence, there are no direct arrows from the indirect-path treatment  $A \to M$  to the outcome process  $Y$ .
Assumptions (A5, A6) define the local independence with respect to the past sequences of the direct- and indirect-path treatment processes  $\mathbf{A}_{<\tau}^{\rightarrow Y}$  and  $\mathbf{A}_{<\tau}^{\rightarrow M}$ . This is in contrast with the definitions of Assumptions (A2, A3), where we only have a single treatment.
A.3.2 Proof of the Identifiability Result
For the total effect, we need to estimate the trajectories  $\mathbf{Y}_{>\tilde{t}_a}[\tilde{\mathbf{a}}_1,\tilde{\mathbf{a}}_1]$  and  $\mathbf{Y}_{>\tilde{t}_a}[\tilde{\mathbf{a}}_0,\tilde{\mathbf{a}}_0]$ , which are identifiable under (A4). For direct and indirect effects, we further need to estimate the counterfactual trajectory  $\mathbf{Y}_{>\tilde{t}_a}[\tilde{\mathbf{a}}_0,\tilde{\mathbf{a}}_1]$ , i.e., the outcome process under a hypothetical intervention, which is identifiable under (A4, A5, A6). In the following, we show the identification result for the outcome process under a hypothetical intervention  $\mathbf{Y}_{>\tilde{t}_a}[\tilde{\mathbf{a}}_0,\tilde{\mathbf{a}}_1]$ , since it is a generalization of the 'factual' trajectories  $\mathbf{Y}_{>\tilde{t}_a}[\tilde{\mathbf{a}}_1,\tilde{\mathbf{a}}_1]$  and  $\mathbf{Y}_{>\tilde{t}_a}[\tilde{\mathbf{a}}_0,\tilde{\mathbf{a}}_0]$ .
We consider a counterfactual trajectory  $\mathbf{Y}_{>\tilde{t}_a}$  under a paired intervention, e.g.  $[\tilde{\mathbf{a}}_0,\tilde{\mathbf{a}}_1]$ , at  $R$  ordered query points  $\mathbf{q} = \{q_r\}_{r = 1}^R$ ,  $q_{r} > \tilde{t}_{a}$ :  $\mathbf{Y}_{\mathbf{q}}[\tilde{\mathbf{a}}_0,\tilde{\mathbf{a}}_1] = \{Y(q_r)[\tilde{\mathbf{a}}_0,\tilde{\mathbf{a}}_1]\}_{r = 1}^R$ . We again start by explicitly writing the interventional trajectory in do-notation:
$$
P (\boldsymbol {Y _ {\mathbf {q}}} [ \varnothing , \tilde {t} _ {a} ]) = P (\boldsymbol {Y _ {\mathbf {q}}} | \mathrm {d o} (\boldsymbol {A} ^ {\rightarrow Y} = \tilde {\mathbf {a}} _ {0}, \boldsymbol {A} ^ {\rightarrow M} = \tilde {\mathbf {a}} _ {1})).
$$
Similar to the analysis with a single intervention in Appendix A.2.2, we define  $M_{>\tilde{t}_a} = \cup_{r=0}^{R-1} M_{[q_r, q_{r+1})}$  and write the conditional distributions of  $Y_q$  and  $M_{>\tilde{t}_a}$  using a factorization in temporal order:
$$
P \left(\mathbf {Y} _ {\mathbf {q}} \left[ \tilde {\mathbf {a}} _ {0}, \tilde {\mathbf {a}} _ {1} \right]\right) = \sum_ {M > t _ {a}} \prod_ {r = 0} ^ {R - 1} P \left( \right.Y _ {q _ {r + 1}} \mid \mathrm {d o} \left(\mathbf {A} ^ {\rightarrow Y} = \tilde {\mathbf {a}} _ {0}, \mathbf {A} ^ {\rightarrow M} = \tilde {\mathbf {a}} _ {1}\right), M _ {\left[ \right. q _ {r}, q _ {r + 1}\left. \right)}, \mathcal {H} _ {\leq q _ {r}}\left. \right)
$$
$$
P \left( \right.M _ {\left[ \right. q _ {r}, q _ {r + 1}\left. \right)} \mid \operatorname {d o} \left(\boldsymbol {A} ^ {\rightarrow Y} = \tilde {\mathbf {a}} _ {0}, \boldsymbol {A} ^ {\rightarrow M} = \tilde {\mathbf {a}} _ {1}\right), \mathcal {H} _ {\leq q _ {r}}\left. \right), \tag {33}
$$
where  $q_0 = \tilde{t}_a$  and  $\mathcal{H}_{\leq q_r}$  denotes the history that contains the past information on the path-specific treatments  $(A^{\rightarrow M}, A^{\rightarrow Y})$  and past mediators up to (non-inclusive)  $q_r$ , and past outcomes up until (inclusive)  $q_r$ :  $\mathcal{H}_{\leq q_r} = A_{\leq q_r}^{\rightarrow M} \cup A_{\leq q_r}^{\rightarrow Y} \cup \{(t_i, m_i) : t_i < q_r\} \cup \{(t_j, y_j) : t_j \leq q_r\}$ .
Let us start with the first term  $P(Y_{q_{r + 1}}|\mathrm{d}\mathrm{o}(\pmb{A}^{\rightarrow Y} = \tilde{\mathbf{a}}_0,\pmb{A}^{\rightarrow M} = \tilde{\mathbf{a}}_1),M_{[q_r,q_{r + 1})},\mathcal{H}_{\leq q_r})$ . We know that the outcome  $Y_{q_{r + 1}}$  at time point  $q_{r + 1}$  is independent of any future interventions:
$$
\begin{array}{l} P \left( \right.Y _ {q _ {r + 1}} \mid \mathrm {d o} \left(\boldsymbol {A} ^ {\rightarrow Y} = \tilde {\mathbf {a}} _ {0}, \boldsymbol {A} ^ {\rightarrow M} = \tilde {\mathbf {a}} _ {1}\right), M _ {\left[ \right. q _ {r}, q _ {r + 1}\left. \right)}, \mathcal {H} _ {\leq q _ {r}}\left. \right) = \\ = P \left(Y _ {q _ {r + 1}} \mid \mathrm {d o} \left(\boldsymbol {A} _ {<   q _ {r + 1}} ^ {\rightarrow Y}\right) = \tilde {\mathbf {a}} _ {0, <   q _ {r + 1}}, \boldsymbol {A} _ {<   q _ {r + 1}} ^ {\rightarrow M} = \tilde {\mathbf {a}} _ {1, <   q _ {r + 1}}\right), M _ {\left[ \right. q _ {r}, q _ {r + 1}\left. \right)}, \mathcal {H} _ {\leq q _ {r}}). \tag {34} \\ \end{array}
$$
(A6) now states that the outcome  $Y(q_{r+1})$  is independent of the past of the indirect-path treatment  $A_{<q_{r+1}}^{\rightarrow M}$  conditioned on the past history  $\mathcal{H}_{<q_{r+1}}$  including the past of the direct-path treatment  $A_{<q_{r+1}}^{\rightarrow Y}$ . Hence, we can change the value of the intervention on  $A_{<q_{r+1}}^{\rightarrow M}$  without changing probability of the conditional term in Eq. (34). Using (A6), we re-write Eq. (34) as
$$
\begin{array}{l} P \left( \right.Y _ {q _ {r + 1}} \mid \mathrm {d o} \left(\boldsymbol {A} _ {<   q _ {r + 1}} ^ {\rightarrow Y} = \tilde {\mathbf {a}} _ {0, <   q _ {r + 1}}, \boldsymbol {A} _ {<   q _ {r + 1}} ^ {\rightarrow M} = \tilde {\mathbf {a}} _ {1, <   q _ {r + 1}}\right), M _ {\left[ \right. q _ {r}, q _ {r + 1}\left. \right)}, \mathcal {H} _ {\leq q _ {r}}\left. \right) \\ = P \left(Y _ {q _ {r + 1}} \mid \operatorname {d o} \left(\boldsymbol {A} _ {<   q _ {r + 1}} ^ {\rightarrow Y}\right) = \tilde {\mathbf {a}} _ {0, <   q _ {r + 1}}, \boldsymbol {A} _ {<   q _ {r + 1}} ^ {\rightarrow M} = \tilde {\mathbf {a}} _ {0, <   q _ {r + 1}}\right), M _ {\left(q _ {r}, q _ {r + 1}\right)}, \mathcal {H} _ {\leq q _ {r}}). \tag {35} \\ \end{array}
$$
Let us continue with the mediator term  $P(M_{[q_r,q_{r + 1})}|\mathrm{d}\mathrm{o}(A\stackrel {\rightarrow Y}{\rightarrow} = \tilde{\mathbf{a}}_0,A\stackrel {\rightarrow M}{\rightarrow} = \tilde{\mathbf{a}}_1),\mathcal{H}_{\leq q_r})$ . The steps will be similar to the discussion above, with one difference: there might be interventions  $\tilde{\mathbf{a}}_{[q_r,q_{r + 1})}$  in the interval  $[q_r,q_{r + 1})$ . Without loss of generality, let us assume there is only a single intervention  $a_{p} = (t_{p},d_{p})$  in the interval  $t_p\in [q_r,q_{r + 1})$ . Then, we consider the mediator term in two parts, namely up to  $t_p$  and after  $t_p$ :
$$
\begin{array}{l} P \left( \right.M _ {\left[ \right. q _ {r}, q _ {r + 1}\left. \right)} \left. \right\rvert \mathrm {d o} \left(\boldsymbol {A} ^ {\rightarrow Y} = \tilde {\mathbf {a}} _ {0}, \boldsymbol {A} ^ {\rightarrow M} = \tilde {\mathbf {a}} _ {1}\right), \mathcal {H} _ {\leq q _ {r}}) \\ = P \left( \right.M _ {[ q _ {r}, t _ {p} ]} \left. \right| \mathrm {d o} \left(\boldsymbol {A} ^ {\rightarrow Y} = \tilde {\mathbf {a}} _ {0}, \boldsymbol {A} ^ {\rightarrow M} = \tilde {\mathbf {a}} _ {1}\right), \mathcal {H} _ {\leq q _ {r}}) \\ P \left(M _ {\left(t _ {p}, q _ {r + 1}\right)} \mid \operatorname {d o} \left(\boldsymbol {A} ^ {\rightarrow Y} = \tilde {\mathbf {a}} _ {0}, \boldsymbol {A} ^ {\rightarrow M} = \tilde {\mathbf {a}} _ {1}\right), M _ {[ q _ {r}, t _ {p} ]}, \mathcal {H} _ {\leq q _ {r}}\right) \tag {36} \\ \end{array}
$$
We know that the mediators  $M_{[q_r, t_p]}$  and  $M_{(t_p, q_{r+1})}$  are independent of any future interventions:
$$
\begin{array}{l} P \left( \right.M _ {\left[ q _ {r}, t _ {p} \right]} \left. \right\rvert   \mathrm {d o} \left(\boldsymbol {A} ^ {\rightarrow Y} = \tilde {\mathbf {a}} _ {0}, \boldsymbol {A} ^ {\rightarrow M} = \tilde {\mathbf {a}} _ {1}\right), \mathcal {H} _ {\leq q _ {r}}) \\ = P \left( \right.M _ {\left[ q _ {r}, t _ {p} \right]} \left. \right| \mathrm {d o} \left(\boldsymbol {A} _ {<   q _ {r}} ^ {\rightarrow Y} = \tilde {\mathbf {a}} _ {0, <   q _ {r}}, \boldsymbol {A} _ {<   q _ {r}} ^ {\rightarrow M} = \tilde {\mathbf {a}} _ {1, <   q _ {r}}\right), \mathcal {H} _ {\leq q _ {r}}) \tag {37} \\ \end{array}
$$
$$
\begin{array}{l} P \left( \right.M _ {\left(t _ {p}, q _ {r + 1}\right)} \left. \right\rvert   \mathrm {d o} \left(\boldsymbol {A} ^ {\rightarrow Y} = \tilde {\mathbf {a}} _ {0}, \boldsymbol {A} ^ {\rightarrow M} = \tilde {\mathbf {a}} _ {1}\right), M _ {\left[ \right. q _ {r}, t _ {p}\left. \right)}, \mathcal {H} _ {\leq q _ {r}}) \\ = P \left(M _ {\left(t _ {p}, q _ {r} + 1\right)} \mid \operatorname {d o} \left(\boldsymbol {A} _ {\leq t _ {p}} ^ {\rightarrow Y} = \tilde {\mathbf {a}} _ {0, \leq t _ {p}}, \boldsymbol {A} _ {\leq t _ {p}} ^ {\rightarrow M} = \tilde {\mathbf {a}} _ {1, \leq t _ {p}}\right), M _ {[ q _ {r}, t _ {p} ]}, \mathcal {H} _ {\leq q _ {r}}\right) \tag {38} \\ \end{array}
$$
(A5) states that the mediator  $M_{[q_r, t_p]}$  (and  $M_{(t_p, q_{r+1})}$ ) is independent of the direct-path treatment  $A_{<q_r}^{\rightarrow Y}$  conditioned on the past history  $\mathcal{H}_{<q_r}$  including the indirect-path treatment  $A_{<q_r}^{\rightarrow M}$ . Using (A5), we re-write Eq. (37) and Eq. (38) as
$$
\begin{array}{l} P \left( \right.M _ {\left[ q _ {r}, t _ {p} \right]} \left. \right\rvert \mathrm {d o} \left(\boldsymbol {A} _ {<   q _ {r}} ^ {\rightarrow Y} = \tilde {\mathbf {a}} _ {0, <   q _ {r}}, \boldsymbol {A} _ {<   q _ {r}} ^ {\rightarrow M} = \tilde {\mathbf {a}} _ {1, <   q _ {r}}\right), \mathcal {H} _ {\leq q _ {r}}) \\ = P \left(M _ {\left[ q _ {r}, t _ {p} \right]} \mid \operatorname {d o} \left(\boldsymbol {A} _ {<   q _ {r}} ^ {\rightarrow Y}\right) = \tilde {\mathbf {a}} _ {1, <   q _ {r}}, \boldsymbol {A} _ {<   q _ {r}} ^ {\rightarrow M} = \tilde {\mathbf {a}} _ {1, <   q _ {r}}\right), \mathcal {H} _ {\leq q _ {r}}) \tag {39} \\ \end{array}
$$
$$
\begin{array}{l} P \left( \right.M _ {\left(t _ {p}, q _ {r + 1}\right)} \left. \right\rvert \mathrm {d o} \left(\boldsymbol {A} _ {\leq t _ {p}} ^ {\rightarrow Y} = \tilde {\mathbf {a}} _ {0, \leq t _ {p}}, \boldsymbol {A} _ {\leq t _ {p}} ^ {\rightarrow M} = \tilde {\mathbf {a}} _ {1, \leq t _ {p}}\right), M _ {\left[ q _ {r}, t _ {p} \right]}, \mathcal {H} _ {\leq q _ {r}}) \\ = P \left(M _ {\left(t _ {p}, q _ {r + 1}\right)} \mid \mathrm {d o} \left(\boldsymbol {A} _ {\leq t _ {p}} ^ {\rightarrow Y} = \tilde {\mathbf {a}} _ {1, \leq t _ {p}}, \boldsymbol {A} _ {\leq t _ {p}} ^ {\rightarrow M} = \tilde {\mathbf {a}} _ {1, \leq t _ {p}}\right), M _ {[ q _ {r}, t _ {p} ]}, \mathcal {H} _ {\leq q _ {r}}\right). \tag {40} \\ \end{array}
$$
Using Eqs. (35), (39) and (40), we re-write Eq. (33) as
$$
P \left(\mathbf {Y} _ {\mathbf {q}} \left[ \tilde {\mathbf {a}} _ {0}, \tilde {\mathbf {a}} _ {1} \right]\right) = \sum_ {M > t _ {a}} \prod_ {r = 0} ^ {R - 1} P \left( \right.Y _ {q _ {r + 1}} \mid \mathrm {d o} \left(\mathbf {A} _ {<   q _ {r + 1}} ^ {\rightarrow Y} = \tilde {\mathbf {a}} _ {0, <   q _ {r + 1}}, \mathbf {A} _ {<   q _ {r + 1}} ^ {\rightarrow M} = \tilde {\mathbf {a}} _ {0, <   q _ {r + 1}}\right), M _ {\left[ \right. q _ {r}, q _ {r + 1}\left. \right)}, \mathcal {H} _ {\leq q _ {r}}\left. \right)
$$
$$
P \left( \right.M _ {\left[ q _ {r}, t _ {p} \right]} \left. \right\rvert \mathrm {d o} \left(\boldsymbol {A} _ {<   q _ {r}} ^ {\rightarrow Y} = \tilde {\mathbf {a}} _ {1, <   q _ {r}}, \boldsymbol {A} _ {<   q _ {r}} ^ {\rightarrow M} = \tilde {\mathbf {a}} _ {1, <   q _ {r}}\right), \mathcal {H} _ {\leq q _ {r}})
$$
$$
P \left(M _ {\left(t _ {p}, q _ {r + 1}\right)} \mid \mathrm {d o} \left(\boldsymbol {A} _ {\leq t _ {p}} ^ {\rightarrow Y} = \tilde {\mathbf {a}} _ {1, \leq t _ {p}}, \boldsymbol {A} _ {\leq t _ {p}} ^ {\rightarrow M} = \tilde {\mathbf {a}} _ {1, \leq t _ {p}}\right), M _ {\left[ q _ {r}, t _ {p} \right]}, \mathcal {H} _ {\leq q _ {r}}\right). \tag {41}
$$
In Eqs. (35), (39) and (40), the target quantities are considered under 'factual' intervention pairs:
$$
\mathrm {d o} \left(\boldsymbol {A} _ {<   \tau} ^ {\rightarrow Y} = \tilde {\mathbf {a}} _ {0, <   \tau}, \boldsymbol {A} _ {<   \tau} ^ {\rightarrow M} = \tilde {\mathbf {a}} _ {0, <   \tau}\right) \equiv \mathrm {d o} \left(\boldsymbol {A} _ {<   \tau} = \tilde {\mathbf {a}} _ {0, <   \tau}\right), \tag {42}
$$
$$
\mathrm {d o} \left(\boldsymbol {A} _ {<   \tau} ^ {\rightarrow Y} = \tilde {\mathbf {a}} _ {1, <   \tau}, \boldsymbol {A} _ {<   \tau} ^ {\rightarrow M} = \tilde {\mathbf {a}} _ {1, <   \tau}\right) \equiv \mathrm {d o} \left(\boldsymbol {A} _ {<   \tau} = \tilde {\mathbf {a}} _ {1, <   \tau}\right). \tag {43}
$$
Using Eqs. (42) and (43), we can simplify Eq. (41) as follows:
$$
P \left(\mathbf {Y} _ {\mathbf {q}} \left[ \tilde {\mathbf {a}} _ {0}, \tilde {\mathbf {a}} _ {1} \right]\right) = \sum_ {M _ {> i _ {a}}} \prod_ {r = 0} ^ {R - 1} P \left(Y _ {q _ {r + 1}} \mid \mathrm {d o} \left(\tilde {\mathbf {a}} _ {0, <   q _ {r + 1}}\right), M _ {\left[ q _ {r}, q _ {r + 1}\right)}, \mathcal {H} _ {\leq q _ {r}}\right)
$$
$$
P \left(M _ {\left[ q _ {r}, t _ {p} \right]} \mid \operatorname {d o} \left(\tilde {\mathbf {a}} _ {1, <   q _ {r}}\right), \mathcal {H} _ {\leq q _ {r}}\right)
$$
$$
P \left(M _ {\left(t _ {p}, q _ {r + 1}\right)} \mid \operatorname {d o} \left(\tilde {\mathbf {a}} _ {1, \leq t _ {p}}\right), M _ {\left[ q _ {r}, t _ {p} \right]}, \mathcal {H} _ {\leq q _ {r}}\right). \tag {44}
$$
In Eq. (44), both terms in the product correspond to the mediator and outcome processes under the interventions  $[\tilde{\mathbf{a}}_0]$  and  $[\tilde{\mathbf{a}}_1]$  respectively. These interventional distributions are identified under (A4), as it states that there are no unobserved confounders between the process pairs  $(\mathbf{A},\mathbf{M})$  and  $(\mathbf{A},\mathbf{Y})$ . Using (A4) on Eq. (44), we obtain the final identification result:
$$
P \left(\mathbf {Y} _ {\mathbf {q}} \left[ \tilde {\mathbf {a}} _ {0}, \tilde {\mathbf {a}} _ {1} \right]\right) = \sum_ {M _ {> \tilde {t} _ {a}}} \prod_ {r = 0} ^ {R - 1} \underbrace {P \left(Y _ {q _ {r + 1}} \mid A = \tilde {\mathbf {a}} _ {0 , <   q _ {r + 1}} , M _ {\left[ q _ {r} , q _ {r + 1}\right)} , \mathcal {H} _ {\leq q _ {r}}\right)} _ {\text {o u t c o m e t e r m ●}} \\ \underbrace {P \left(M _ {\left[ q _ {r} , t _ {p} \right]} \mid A = \tilde {\mathbf {a}} _ {1 , <   q _ {r}} , \mathcal {H} _ {\leq q _ {r}}\right) P \left(M _ {\left(t _ {p} , q _ {r + 1}\right)} \mid A = \tilde {\mathbf {a}} _ {1 , \leq t _ {p}} , M _ {\left[ q _ {r} , t _ {p} \right]} , \mathcal {H} _ {\leq q _ {r}}\right)} _ {\text {m e d i a t o r i n t e n s i t y ●}}. \tag {45}
$$
To estimate the direct and indirect effects, now the joint mediator-outcome model needs to take the treatment history  $\tilde{\mathbf{a}}$  into account.
B Interacting Mediator-Outcome Model
Our interacting mediator-outcome model builds on marked point processes [MPP, Daley and Vere-Jones, 2003] and Gaussian processes [GP, Williams and Rasmussen, 2006]. Hence, we first introduce MPPs (B.1) and GPs (B.2). We describe our model in detail in B.3 and discuss learning and inference in B.4. Finally, we discuss computational complexity and scalability of our model in B.5.
B.1 Marked Point Processes
A temporal point process (TPP) is a stochastic process that models continuous-time event sequences, e.g., a sequence of treatment times  $\mathcal{D} = \{t_i\}_{i=1}^I$  over a period  $[0,T]$  [Daley and Vere-Jones, 2003, Rasmussen, 2011]. A TPP can be represented by a counting process  $N:[0,T] \to \mathbb{Z}_{\geq 0}$ , which outputs the number of points until time  $\tau$ :  $N(\tau) = \sum_{i=1}^{N} \mathbb{1}[t_i \leq \tau]$ . We assume that there can be at most one point in an infinitesimal interval  $[\tau - \Delta \tau, \tau]$ :  $\Delta N \in \{0,1\}$ , where  $\Delta N = \lim_{\Delta \tau \downarrow 0}(N(\tau) - N(\tau - \Delta \tau))$ . The counting process  $N(\tau)$ , and hence the change  $\Delta N$ , can be decomposed into a predictable compensator function  $\mathbb{E}[N(\tau)] = \Lambda(\tau)$  and a zero-mean noise process (martingale)  $U(\tau)$  by the Doob-Meyer theorem [Didelez, 2008]:
$$
N (\tau) = \Lambda (\tau) + U (\tau) \tag {46}
$$
Using the Doob-Meyer decomposition, a TPP can be uniquely determined by the expected rate of change in its counting process:  $\mathbb{E}[\Delta N\mid \mathcal{H}_{< \tau}] = \Delta \Lambda \mid \mathcal{H}_{< \tau} = \lambda^{*}(\tau)\mathrm{d}\tau$ , where the function  $\lambda^{*}(\tau) = \lambda (\tau \mid \mathcal{H}_{< \tau})$  is called the conditional intensity function and the star superscript is shorthand notation for the dependence on the history  $\mathcal{H}_{< \tau} = \{t_i:t_i < \tau ,i = 1,\ldots ,I\}$ .
When a temporal point carries additional information (mark,  $m$ ), e.g., a sequence of treatment times and dosages  $\mathcal{D} = \{(t_i, m_i)\}_{i=1}^I$ , we model a sequence of time-mark pairs using a marked point process (MPP). Accordingly, the conditional intensity function  $\lambda^*(t, m)$  is extended such that it includes the mark intensity:  $\lambda^*(t, m) = \lambda^*(t) \lambda^*(m \mid t)$ . Using the conditional intensity function, we can write the joint distribution of  $\mathcal{D}$  as follows [Rasmussen, 2011]:
$$
p (\mathcal {D}) = \prod_ {i = 1} ^ {I} \lambda^ {*} \left(m _ {i} \mid t _ {i}\right) \lambda^ {*} \left(t _ {i}\right) \exp \left(- \int_ {0} ^ {T} \lambda^ {*} (\tau) d \tau\right). \tag {47}
$$
B.2 Gaussian Processes
A Gaussian process [GP, Williams and Rasmussen, 2006] describes a prior distribution  $\mathcal{GP}$  over a continuous-valued function  $f:\mathbb{R}^D\to \mathbb{R}$ :
$$
f (\cdot) \sim \mathcal {G P} (\mu (\cdot), k (\cdot , \cdot^ {\prime})), \tag {48}
$$
where a mean function  $\mu : \mathbb{R}^D \to \mathbb{R}$  represents the expectation  $\mu(\cdot) = \mathbb{E}[f(\cdot)]$ , and a symmetric positive-definite kernel function  $k: \mathbb{R}^D \times \mathbb{R}^D \to \mathbb{R}$  represents the covariance  $k(\cdot, \cdot') = \operatorname{cov}(\cdot, \cdot')$ . In practice, we do not deal with infinite-sized distributions, rather we only consider evaluations of the
GP at a finite number of input points. The GP prior  $f(\mathbf{x})$  of any subset of  $N$  data points  $\mathbf{x} \in \mathbb{R}^{N \times D}$  follows a joint Gaussian distribution:
$$
f (\mathbf {x}) = \mathbf {f} \sim \mathcal {N} \left(\boldsymbol {\mu} _ {\mathbf {x}}, \mathbf {K} _ {\mathbf {x x}}\right), \tag {49}
$$
where the mean  $\mu_{\mathbf{x}} = \mu (\mathbf{x})\in \mathbb{R}^{N}$  is obtained by evaluating the mean function  $\mu (\cdot)$  at  $N$  input points and the covariance matrix  $\mathbf{K}_{\mathbf{x}\mathbf{x}} = k(\mathbf{x},\mathbf{x}^{\prime})\in \mathbb{R}^{N\times N}$  is obtained by evaluating the kernel function  $k(\cdot ,\cdot ')$  at  $N\times N$  input pairs. Commonly, we assume zero mean  $\mu_{\mathbf{x}} = \mathbf{0}$ .
For a given set of  $N$  training points  $\mathbf{x}$  and  $N_{*}$  test points  $\mathbf{x}_{*}$ , we can use the joint Gaussian property of GPs and write the joint distribution of  $\mathbf{f} = f(\mathbf{x})$  and  $\mathbf{f}_{*} = f(\mathbf{x}_{*})$ :
$$
\left[ \begin{array}{l} \mathbf {f} \\ \mathbf {f} _ {*} \end{array} \right] \sim \mathcal {N} \left(\mathbf {0}, \left[ \begin{array}{l l} \mathbf {K} _ {\mathbf {x x}} & \mathbf {K} _ {\mathbf {x x} _ {*}} \\ \mathbf {K} _ {\mathbf {x} _ {*} \mathbf {x}} & \mathbf {K} _ {\mathbf {x} _ {*} \mathbf {x} _ {*}} \end{array} \right]\right), \tag {50}
$$
where the cross-covariance matrix  $\mathbf{K}_{\mathbf{x}\mathbf{x}_*} \in \mathbb{R}^{N \times N_*}$  is obtained by evaluating the kernel function at  $N \times N_*$  input pairs. Using the conditional distribution identities of the Gaussian distribution, we write the posterior distribution  $p(\mathbf{f}_* \mid \mathbf{f})$ :
$$
\mathbf {f} _ {*} \mid \mathbf {f} \sim \mathcal {N} \left(\mathbf {K} _ {\mathbf {x} _ {*} \mathbf {x}} \mathbf {K} _ {\mathbf {x x}} ^ {- 1} \mathbf {f}, \mathbf {K} _ {\mathbf {x} _ {*} \mathbf {x} _ {*}} - \mathbf {K} _ {\mathbf {x} _ {*} \mathbf {x}} \mathbf {K} _ {\mathbf {x x}} ^ {- 1} \mathbf {K} _ {\mathbf {x x} _ {*}}\right). \tag {51}
$$
Taking the inverse of a matrix is computationally expensive. Its computational complexity is  $\mathcal{O}(N^3)$ , which is unfeasible for large data sets. To make the GP inference scalable, one common method is to use inducing point approximations [Quinonero Candela and Rasmussen, 2005]. For this, we choose a set of  $M$  inducing variables  $\mathbf{u} = f(\mathbf{z}) \in \mathbb{R}^{M}$  evaluated at  $M$  inducing points  $\mathbf{z} \in \mathbb{R}^{M \times D}$ , where  $M \ll N$ . Using the same conditional Gaussian identity, we can write the conditional distribution of the function  $f$  conditioned on the inducing variables  $\mathbf{u}$  as follows
$$
\mathbf {f} \mid \mathbf {u} \sim \mathcal {N} \left(\mathbf {K} _ {\mathbf {x z}} \mathbf {K} _ {\mathbf {z z}} ^ {- 1} \mathbf {u}, \quad \mathbf {K} _ {\mathbf {x x}} - \mathbf {K} _ {\mathbf {x z}} \mathbf {K} _ {\mathbf {z z}} ^ {- 1} \mathbf {K} _ {\mathbf {z x}}\right), \tag {52}
$$
where the inverse is now only required of a much smaller matrix  $\mathbf{K}_{\mathbf{zz}} \in \mathbb{R}^{M \times M}$ .
B.3 Model Definition
For the joint model definition, we extend a non-parametric mediator-outcome model [Hizli et al., 2023] to include an external intervention  $A$  that jointly affects both mediators and outcomes. Similar to Hizli et al. [2023], we combine an MPP and a conditional GP to model the interacting mediator-outcome processes. The binary value of the treatment process  $A(\tau) \in \{0,1\}$  acts as a regime indicator, which specifies whether the treatment is active or not. The structural causal model for the treatment process  $A$ , the mediator process  $M$ , and the outcome process  $Y$  can be written as follows:
$$
A (\tau) := \mathbb {1} \{\tau \geq \tilde {t} _ {a} \} \in \{0, 1 \},
$$
$$
M (\tau) := f _ {M} ^ {(a)} (\tau , \mathcal {H} _ {<   \tau}) + U _ {M} ^ {(a)} (\tau), \tag {53}
$$
$$
Y (\tau) := f _ {Y} ^ {(a)} (\tau , \mathcal {H} _ {<   \tau}) + U _ {Y} ^ {(a)} (\tau), \tag {54}
$$
where  $\tau \in [0,T]$ ,  $U_{M}(\tau)$  is a zero-mean noise process, and  $U_{Y}(\tau)$  is a zero mean Gaussian noise. Eqs. (53) and (54) capture the mediator term  $(\odot)$  and the outcome term  $(\bullet)$  in Eq. (27) respectively. The mediator and outcome terms are detailed in Appendices B.3.1 and B.3.2 for a single regime  $a$  since we use equivalent model definitions for both pre- and post-intervention regimes.
B.3.1 Mediator Intensity