
## Algorithm 1 **Grouplingam**

1: Given a p-dimensional variables x, a set of its subscripts V , a p×n **data matrix**
of the variables X, initialize an ordered subset of variables as K ← ∅.

2: Call K ← **GroupSearch (**V , K, X).

3: Construct a lower block-triangular matrix B by following the order in K**, and**
estimate the connection strengths bij **(using some conventional covariance-based**
regression, such as least-squares and maximum-likelihood approaches) on the original variables x **and data matrix** X.

function K ← **GroupSearch (**U, K, XU )
1: for S ⊂ U do 2: Perform least-squares regression of xS on xU\S **(denote the residual vector**
by r
(S) and its residual data matrix by R(S)) and then compute some independence measure I(S) between xS and r
(S), e.g., M I(xS, r
(S)).

3: **end for**
4: S∗ **:= arg min** I(S).

5: if I(S∗) ≤ δ and |U| 6= 1 **then**
6: Set XU\S∗ ← R(S∗).

7: Call K ← GroupSearch (S∗**, K,** XS∗
)
8: Call K ← GroupSearch (U \ S∗**, K,** XU\S∗

)
9: **else**
10: Append S∗ **to the end of** K.

11: **end if**
devided, and the resulting order of the sets of variable subscripts **shows the causal** order of the original observed variables according to Corollary 5.

As the independence measure used in Lemma 3, the mutual information between the subset of variable and the residuals, i.e., M I(xS, r
(S)**), would be available.**
There are many options for its estimation from data. In the later experiments, we used an algorithm based on the k-nearest neighbors method [6].4 **This method has**
one tuning parameters, i.e., the number of neighbors kneig**. Although the setup of** this parameter is not trivial, the algorithm is known to work well empirically when kneig is set as 3–5 % of the dimensional p **[6].**
3.2. GroupLiNGAM algorithm. **Based on the above result, we now present an**
algorithm to estimate a block causal ordering and the connection strengths in the GroupLiNGAM model under the correlation-faithfulness assumption. The pseudocode of the algorithm is shown in Alg. 1.

The algorithm is performed by the recursive calls of GroupSearch function, which devides a given subset U into ordered two groups. Since an exogenous set is identified by evaluating the independence between a subset of U **and its residuals from**
Lemma 3, we find such subset S∗(⊂ U) as the one that minimizes some independence measure I(S) (Lines 1–3 in GroupSearch in Alg. 1). Thus, U **is divided into**
ordered two groups S∗ and U \ S∗. From Lemma 4, for each of S∗ and U \ S∗,
the GroupLiNGAM models hold. Therefore, this procedure is iterated until further partition cannot be found, which is judged with a threshold δ **(Line 8–9 in**
6