SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Proposition 2. Under Assumption  $D$ , an edge  $(X_{i}\to X_{j})$  is a functionally shifted edge, as in Definition 5, if and only if the basis coefficients are different. That is,
$$
\frac {\partial f _ {j} ^ {h}}{\partial x _ {i}} \neq \frac {\partial f _ {j} ^ {h ^ {\prime}}}{\partial x _ {i}} \Longleftrightarrow \beta_ {j i} ^ {h} \neq \beta_ {j i} ^ {h ^ {\prime}}.
$$
$$
\frac {\partial f _ {j} ^ {h}}{\partial x _ {i}} = \frac {\mathrm {d} f _ {j i} ^ {h} (x _ {i})}{\mathrm {d} x _ {i}} = \frac {\mathrm {d} (\Psi_ {j i} (x _ {i}) \beta_ {j i} ^ {h})}{\mathrm {d} x _ {i}} = \frac {\mathrm {d} \Psi_ {j i} (x _ {i})}{\mathrm {d} x _ {i}} \beta_ {j i} ^ {h}.
$$
$$
\frac {\partial f _ {j} ^ {h}}{\partial x _ {i}} - \frac {\partial f _ {j} ^ {h ^ {\prime}}}{\partial x _ {i}} = \frac {\mathrm {d} \Psi_ {j i} \left(x _ {i}\right)}{\mathrm {d} x _ {i}} \left(\beta_ {j i} ^ {h} - \beta_ {j i} ^ {h ^ {\prime}}\right) \neq \mathbf {0} \Longleftrightarrow \beta_ {j i} ^ {h} - \beta_ {j i} ^ {h ^ {\prime}} \neq \mathbf {0}
$$
The last  $\Longleftrightarrow$  relation is due to the linear independence of the basis functions  $\Psi_{ji}$ , then the null space of  $\frac{\mathrm{d}\Psi_{ji}}{\mathrm{d}x_i}$  can only be the zero vector  $\mathbf{0}$ .
Note that the output of Algorithm 1 also estimates a topological order  $\hat{\pi}$ . However, the exact parents of a node  $X_{j}$  across the environments are not known, and they are possibly different. To estimate the coefficients without knowledge of the exact parents, we can consider the set  $\widehat{\operatorname{Pre}(X_j)}$ , which consists of nodes located before  $X_{j}$  in the topological order  $\hat{\pi}$ . By regressing  $X_{j}$  on  $\widehat{\operatorname{Pre}(X_j)}$  for each environment, we can obtain coefficient estimations, which are the same coefficients obtained by regressing  $X_{j}$  on its exact parents, in large samples.
Theorem 3. In large samples, let  $\{\tilde{\beta}_{jk}^h\}_{k\in \mathrm{Pre}(X_j)}$  be the coefficients obtained by regressing  $X_{j}$  on the feature mapping of  $\operatorname {Pre}(X_j)$ , and let  $\{\beta_{jk}^{h}\}_{k\in \mathrm{PA}_{j}}$  be the coefficients obtained by regressing  $X_{j}$  on the feature mapping of  $\mathrm{PA}_j$ . Then,  $\tilde{\beta}_{jk}^{h} = \beta_{jk}^{h}$  if  $k\in \mathrm{PA}_j^h$ , and  $\tilde{\beta}_{jk}^{h} = 0$  if  $k\in \operatorname {Pre}(X_j)\setminus \mathrm{PA}_j^h$ .
Proof. Proof can be found in Appendix B.3.
Motivated by Theorem 3, and given an estimated  $\{\tilde{\beta}_{jk}^h\}_{k\in \widehat{\mathrm{Pre}} (X_j)}$ , one could conduct a hypothesis testing as follows:
$$
H _ {0}: \tilde {\beta} _ {j k} ^ {1} = \dots = \tilde {\beta} _ {j k} ^ {H} \tag {13}
$$
If the null hypothesis  $H_0$  is rejected, it indicates that there is evidence of a functionally shifted edge between nodes  $X_{k}$  and  $X_{j}$  across the environments. In this paper we leave the hypothesis test unspecified to allow for any procedure that can test eq.(13).
Algorithm 5 Functionally shifted edges detection
Input: Sample data  $X^1, \ldots, X^H$ , shifted nodes set  $\widehat{S}$ , topological order  $\hat{\pi}$ , significance level  $\alpha$ .
Output: Set of functionally shifted edges  $\widehat{E}$
1: for  $j\in \widehat{S}$  do
2: Estimate  $\tilde{\beta}_{jk}^{h}$  for all  $k\in \widehat{\mathrm{Pre}} (X_j)$  and  $h\in [H]$
3: for  $k \in \widetilde{\mathrm{Pre}}(X_j)$  do
4: Conduct hypothesis testing  $H_0$  (equation 13) under significant level  $\alpha$ .
5: If  $H_0$  is rejected, add edge  $(X_k \to X_j)$  to  $\widehat{E}$ .