Learning latent causal graphs via mixture oracles

Bohdan Kivva, Goutham Rajendran, Pradeep Ravikumar, Bryon Aragam

Introduction

Understanding causal relationships between objects and/or concepts is a core component of human reasoning, and by extension, a core component of artificial intelligence . Causal relationships are robust to perturbations, encode invariances in a system, and enable agents to reason effectively about the effects of their actions in an environment. Broadly speaking, the problem of inferring causal relationships can be broken down into two main steps: 1) The extraction of high-level causal features from raw data, and 2) The inference of causal relationships between these high-level features. From here, one may consider estimating the magnitude of causal effects, the effect of interventions, reasoning about counterfactuals, etc. Our focus in this paper will be the problem of learning causal relationships between latent variables, which is closely related to the problem of learning causal representations . This problem should be contrasted with the equally important problem of causal inference in the presence of latent confounders [16, 69, 5, 34, 71, e.g.]; see also Remark 2.1.

Causal graphical models provide a natural framework for this problem, and have long been used to model causal systems with hidden variables . It is well-known that in general, without additional assumptions, a causal graphical model given by a directed acyclic graph (DAG) is not identifiable in the presence of latent variables [54, 65, e.g.,]. In fact, this is a generic property of nonparametric structural models: Without assumptions, identifiability is impossible, however, given enough structure, identifiability can be rescued. Examples of this phenomenon include linearity , independence , rank , sparsity , and graphical constraints .

In this paper, we consider a general setting for this problem with discrete latent variables, while allowing otherwise arbitrary (possibly nonlinear) dependencies. The latent causal graph between the latent variables is also allowed to be arbitrary: No assumptions are placed on the structure of this DAG. We do not assume that the number of hidden variables, their state spaces, or their relationships are known; in fact, we provide explicit conditions under which all of this can be recovered uniquely. To accomplish this, we highlight a crucial reduction between the problem of learning a DAG model over these variables—given access only to the observed data—and learning the parameters of a finite mixture model. This observation leads to new identifiability conditions and algorithms for learning causal models with latent structure.

Our starting point is a simple reduction of the graphical model recovery problem to three modular subproblems:

The bipartite graph Γ\Gamma between hidden and observed nodes,

A directed acyclic graph (DAG) Λ\Lambda over the latent distribution.

This perspective leads to a systematic, modular approach for learning the latent causal graph via mixture oracles (see Section 2 for definitions). Ultimately, the application of these ideas requires a practical implementation of this mixture oracle, which is discussed in Section 6.

Contributions

More precisely, we make the following contributions:

(Section 3) We provide general conditions under which the latent causal model GG is identifiable (Theorem 3.2). Surprisingly, these conditions mostly amount to nondegeneracy conditions on the joint distribution. As we show, without these assumptions identifiability breaks down and reconstruction becomes impossible.

(Section 4) We carefully analyze the problem of reconstructing Γ\Gamma under progressively weaker assumptions: First, we derive a brute-force algorithm that identifies Γ\Gamma in a general setting (Theorem 4.2), and then under a linear independence condition we derive a polynomial-time algorithm based on tensor decomposition and Jennrich’s algorithm (Theorem 4.8).

(Section 6-7) We implement these algorithms as part of an end-to-end pipeline for learning the full causal graph and illustrate its performance on simulated data.

A prevailing theme throughout is the fact that the hidden variables leave a recognizable “signature” in the observed data through the marginal mixture models induced over subsets of observed variables. By cleverly exploiting these signatures, the number of hidden variables, their states, and their relationships can be recovered exactly.

Previous work

Latent variable graphical models have been extensively studied in the literature; as such we focus only on the most closely related work on causal graphical models here. Early work on this problem includes seminal work by Martin and VanLehn , Friedman et al. Elidan et al. . More recent work has focused on linear models or known structure . When the structure is not known a priori, we find ourselves in the realm of structure learning, which is our focus. Less is known regarding structure learning between latent variables for nonlinear models, although there has been recent progress based on nonlinear ICA . For example, proposed CausalVAE, which assumes a linear structural equation model and knowledge of the concept labels for the latent variables, in order to leverage the iVAE model from . By contrast, our results make no linearity assumptions and do not require these additional labels. While this paper was under review, we were made aware of the recent work that studies a similar problem to ours in a general, nonlinear setting under faithfulness assumptions. It is also worth noting recent progress on learning discrete Boltzmann machines , which can be interpreted as an Ising model with a bipartite structure and a single hidden layer—in particular, there is no hidden causal structure. Nevertheless, this line of work shows that learning Boltzmann machines is computationally hard in a precise sense. More broadly, the problem of learning latent structure has been studied in a variety of other applications including latent Dirichlet allocation , phylogenetics , and hidden Markov models .

A prevailing theme in the causal inference literature has been negative results asserting that in the presence of latent variables, causal inference is impossible . Our results do not contradict this important line of work, and instead adopts a more optimistic tone: We show that under reasonable assumptions—essentially that the latent variables are discrete and well-separated—identifiability and exact recovery of latent causal relationships is indeed possible. This optimistic approach is implicit in recent progress on visual relationship detection , causal feature learning , and interaction modeling . In this spirit, our work provides theoretical grounding for some of these ideas.

Mixture models and clustering

While our theoretical results in Sections 3-5 assume access to a mixture oracle (see Definition 2.5), in Section 6 we discuss how this oracle can be implemented in practice. To provide context for these results, we briefly mention related work on learning mixture models from data. Mixture models can be learned under a variety of parametric and nonparametric assumptions. Although much is known about parametric models [40, e.g.], of more interest to us are nonparametric models in which the mixture components are allowed to be flexible, such as mixtures of product distributions , grouped observations and general nonparametric mixtures . In each of these cases, a mixture oracle can be implemented without parametric assumptions. In practice, we use clustering algorithms such as KK-means or hierarchical clustering to implement this oracle. We note also that the specific problem of consistently estimating the order of a mixture model, which will be of particular importance in the sequel, has been the subject of intense scrutiny in the statistics literature [46, 38, 20, 15, e.g.].

Broader impacts and societal impact

Latent variable models have numerous practical applications. Many of these applications positively address important social problems, however, these models can certainly be applied nefariously. For example, if the latent variables represent private, protected information, our results imply that this hidden private data can be leaked into publicly released data, which is obviously undesirable. Understanding how to infer unprotected data while safeguarding protected data is an important problem, and our results shed light on when this is and isn’t possible.

Notation

An important consequence of the Markov property is that it allows one to read off conditional independence relations from the graph GG. More specifically, we have the following [see 54, 65, for details]:

For each v∈Vv\in V, vv is independent of its non-descendants, given its parents.

Throughout this paper, we use standard notation such as \pa(j)\pa(j) for parents, ch⁡(j)\ch(j) for children, and \nbhd(j)\nbhd(j) for neighbors. Specifically, we define

The parents of a node v∈Vv\in V are denoted by \pa(v)={u∈V:(u,v)∈E}\pa(v)=\{u\in V:(u,v)\in E\};

The children of a node v∈Vv\in V are denoted by ch⁡(v)={u∈V:(v,u)∈E}\ch(v)=\{u\in V:(v,u)\in E\};

The neighborhood of a node v∈Vv\in V is denoted by \nbhd(v)=\pa(v)∪ch⁡(v)\nbhd(v)=\pa(v)\cup\ch(v).

Given a subset V′⊂VV^{\prime}\subset V, \pa(V′):=∪j∈V′\pa(j)\pa(V^{\prime}):=\cup_{j\in V^{\prime}}\pa(j) and given a subgraph G′⊂GG^{\prime}\subset G, \paG′(V′):=\pa(V′)∩G′\pa_{G^{\prime}}(V^{\prime}):=\pa(V^{\prime})\cap G^{\prime}, with similar notation for children and neighbors. We let A∈{0,1}∣X∣×∣H∣A\in\{0,1\}^{|X|\times|H|} denote the adjacency matrix of Γ\Gamma and denote its columns by aj∈{0,1}∣X∣a_{j}\in\{0,1\}^{|X|}. Finally, we adopt the convention that HH is identified with the indices [m]={1,…,m}[m]=\{1,\ldots,m\}, and similar XX is identified with [n]={1,…,n}[n]=\{1,\ldots,n\}. In particular, we use \pa(i)\pa(i) and \pa(Hi)\pa(H_{i}) interchangeably when the context is clear.

Background

Throughout this paper, we use standard notation such as \pa(j)\pa(j) for parents, ch⁡(j)\ch(j) for children, and \nbhd(j)\nbhd(j) for neighbors. Given a subset V′⊂VV^{\prime}\subset V, \pa(V′):=∪j∈V′\pa(j)\pa(V^{\prime}):=\cup_{j\in V^{\prime}}\pa(j) and given a subgraph G′⊂GG^{\prime}\subset G, \paG′(V′):=\pa(V′)∩G′\pa_{G^{\prime}}(V^{\prime}):=\pa(V^{\prime})\cap G^{\prime}, with similar notation for children and neighbors. We let A∈{0,1}∣X∣×∣H∣A\in\{0,1\}^{|X|\times|H|} denote the adjacency matrix of Γ\Gamma and denote its columns by aj∈{0,1}∣X∣a_{j}\in\{0,1\}^{|X|}.

It is well-known that without additional assumptions, the latent variables HH cannot be identified from XX, let alone the DAG Λ\Lambda. For example, we can always replace a pair of distinct hidden variables HiH_{i} and HjH_{j} with a single hidden variable H0H_{0} that takes values in Ωi×Ωj\Omega_{i}\times\Omega_{j}. Similarly, a single latent variable can be split into two or more latent variables. In order to avoid this type of degeneracy, we make the following assumptions:

For any hidden variables Hi≠HjH_{i}\neq H_{j} we have \nbhdΓ(Hi)≠\nbhdΓ(Hj)\nbhd_{\Gamma}(H_{i})\neq\nbhd_{\Gamma}(H_{j}).

There is no DAG G′=((X,H′),E′)G^{\prime}=((X,H^{\prime}),E^{\prime}) such that:

G′G^{\prime} is obtained from GG by splitting a hidden variable (equivalently, GG is obtained from G′G^{\prime} by merging a pair of vertices);

The distribution over V=(X,H)V=(X,H) satisfies:

\prob(H=h)>0\prob(H=h)>0 for all h∈Ω1×…×Ωkh\in\Omega_{1}\times\ldots\times\Omega_{k}.

For all S⊂XS\subset X and a≠ba\neq b, \prob(S∣\pa(S)=a)≠\prob(S∣\pa(S)=b)\prob(S|\pa(S)=a)\neq\prob(S|\pa(S)=b), where aa and bb are distinct configurations of \pa(S)\pa(S).

Without this nondegeneracy condition, HH cannot be identified; see Appendix A for details.

2 Mixture oracles

When S=XS=X, this can be interpreted as a mixture model with K:=∣Ω∣K:=|\Omega| components. When S⊊XS\subsetneq X, however, multiple components can “collapse” onto the same component, resulting in a mixture with fewer than KK components. Let k(S)k(S) denote this number, so that we may define a discrete random variable ZZ with k(S)k(S) states such that for all j∈[k(S)]j\in[k(S)], we have

Then π(S,j)\pi(S,j) is the weight of the jjth mixture component over SS, and C(S,j)C(S,j) is the corresponding jjth component. It turns out that these probabilities precisely encode the conditional independence structure of HH. To make this formal, we define the following oracle:

A mixture oracle is an oracle that takes S⊂XS\subset X as input and returns the number of components k(S)k(S) as well as the weights π(S,j)\pi(S,j) and components C(S,j)C(S,j) for each j∈[k(S)]j\in[k(S)]. This oracle will be denoted by MixOracle(S)\mathsf{MixOracle}(S).

Although our theoretical results are couched in the language of this oracle, we provide practical implementation details in Section 6 and experiments to validate our approach in Section 7.

In fact, we do not need the full power of MixOracle\mathsf{MixOracle}. For our algorithms it is sufficient to have access to k(S)k(S) for a sufficiently large family of S⊂XS\subset X, the list of weights π(X,j)\pi(X,j), and a map that relates components in the full mixture over XX to the components in the marginal mixtures over each variable XiX_{i} (see Section 5 for details).

Before concluding this section, we note an important consequence of Assumption 2.4 that will be used in the sequel:

Under Assumption 2.4, for any S⊆XS\subseteq X

By the Markov property, SS is independent of H∖\pa(S)H\setminus\pa(S). There are dim⁡(\pa(S))\dim(\pa(S)) possible assignments to the hidden variables in \pa(S)\pa(S) and by Assumption 2.4, distinct assignments to the hidden variables induce distinct components in the marginal distribution P(S)P(S). Hence, by definition, k(S)=dim⁡(\pa(S))k(S)=\dim(\pa(S)). ∎

Recovery of the latent causal graph

We first consider the oracle setting in which we have access to MixOracle(S)\mathsf{MixOracle}(S).

Thus, the problem of learning GG is reduced to the mixture oracle:

We say that the bipartite graph Γ\Gamma satisfies the subset condition (SSC) if for any pair of distinct hidden variables Hi,HjH_{i},H_{j} the set \nbhdΓ(Hi)\nbhd_{\Gamma}(H_{i}) is not a subset of \nbhdΓ(Hj)\nbhd_{\Gamma}(H_{j}).

This assumption is weaker than the common “anchor words" assumption from the topic modeling literature. The latter assumption says that every topic has a word that is unique to this topic, and it is commonly assumed for efficient recovery of latent structure .

Under Assumption 3.1, we have the following key result:

The proof is constructive and leads to an efficient algorithm as alluded to in the previous theorem. An overview of the main ideas behind the proof of this result are presented in Sections 4 and 5; the complete proof of this theorem can be found in Appendices B-D.

A mixture oracle exists if the mixture model over XX is identifiable. As discussed in Section 1, such identifiability results are readily available in the literature. For example, assume that for every S⊆XS\subseteq X, the mixture model (2) comes from any of the following families:

a well-separated (i.e. in TV distance) nonparametric mixture .

Identifiability of Λ\Lambda

Learning the bipartite graph

In this section we outline the main ideas behind the recovery of Γ\Gamma in Theorem 3.2. We begin by establishing conditions that ensure Γ\Gamma is identifiable, and then proceed to consider efficient algorithms for its recovery.

We study a slightly more general setup in which the identifiability of Γ\Gamma depends on how much information we request from the MixOracle\mathsf{MixOracle}. Clearly, we want to rely on MixOracle\mathsf{MixOracle} as little as possible. As the proofs in the supplement indicate, the only information required for this step are the number of components. Neither the weights nor the components are needed.

We say that Γ\Gamma is tt-recoverable if Γ\Gamma can be uniquely recovered from XX and the sequence (MixOracle(S)∣∣S∣≤t)(\mathsf{MixOracle}(S)\mid|S|\leq t).

Let Γ\Gamma be the bipartite graph between XX and HH.

Assume that \nbhdΓ(Hi)≠\nbhdΓ(Hj)\nbhd_{\Gamma}(H_{i})\neq\nbhd_{\Gamma}(H_{j}) for any i≠ji\neq j. Then Γ\Gamma and dim⁡(Hi)\dim(H_{i}) are nn-recoverable.

Let t≥3t\geq 3. Assume that for every S⊆HS\subseteq H with ∣S∣≥2|S|\geq 2 we have

then Γ\Gamma and dim⁡(Hi)\dim(H_{i}) are tt-recoverable.

Note that Assumption 3.1 implies the assumption in Theorem 4.2(a). Finally, as in Section 2, we argue that in the absence of additional assumptions, this assumption is in fact necessary:

If there is a pair of distinct variables Hi,Hj∈HH_{i},H_{j}\in H such that \nbhdΓ(H1)=\nbhdΓ(H2)\nbhd_{\Gamma}(H_{1})=\nbhd_{\Gamma}(H_{2}), then Γ\Gamma is not nn-recoverable.

2 Ideas behind the recovery

In Corollary 4.4 below, we recast Observation 2.7 as an additive identity. This transforms the problem of learning Γ\Gamma into an instance of more general problem that is discussed in the appendix. The results of this section apply to this more general version.

Assume that Assumptions 2.4 hold. For Hi∈HH_{i}\in H define w(Hi)=log⁡(dim⁡(Hi))w(H_{i})=\log(\dim(H_{i})). Then for every set S⊆XS\subseteq X

In order to argue about the causal structure of the hidden variables we first need to identify the variables themselves. By Assumption 2.2, every hidden variable leaves a “signature” among the observed variables, which is the set \nbhdΓ(Hi)\nbhd_{\Gamma}(H_{i}) of observed variables it affects. In particular, note that Hi∈⋂Xs∈\nbhdΓ(Hi)\pa(Xs)H_{i}\in\bigcap_{X_{s}\in\nbhd_{\Gamma}(H_{i})}\pa(X_{s}), and if there is no HjH_{j} with \nbhdΓ(Hi)⊂\nbhdΓ(Hj)\nbhd_{\Gamma}(H_{i})\subset\nbhd_{\Gamma}(H_{j}), then HiH_{i} is the unique element of the intersection. The lemma above allows us to extract information about the union of parent sets, and we wish to turn it into the information about intersections. This motivates the following definitions.

The proof of this lemma is a simple application of the Inclusion-Exclusion principle.

The RHS of Eq. (6) only depends on WW evaluated on subsets of SS. Thus, in particular, if ∣S∣≤t|S|\leq t to compute \comW(S)\comW(S) it is enough to know MixOracle\mathsf{MixOracle} on all sets of size ≤t\leq t.

Finally, the values of the function \comWΓ\comW_{\Gamma} can be organized into a tensor, and from here the problem of learning Γ\Gamma can be cast as decomposition problem for this tensor. These proof details are spelled out in Appendix B; in the next section we illustrate this procedure for the special case of 3-recovery.

3 Efficient 33-recovery

Under a simple additional assumption Γ\Gamma can be recovered efficiently. We are primarily interested in the case t=3t=3. The main idea is to note that a rank-three tensor involving the columns of AA can be written in terms of \comWΓ\comW_{\Gamma}. We can then apply Jennrich’s algorithm to decompose the tensor and recover these columns, which yield Γ\Gamma. To see this, let I=(i1,i2,i3)⊆XI=(i_{1},i_{2},i_{3})\subseteq X be a triple of indices, and note that

Assume that the columns of AA are linearly independent. Then Γ\Gamma and dim⁡(Hi)\dim(H_{i}), for all ii, are 33-recoverable in O(n3)O(n^{3}) space and O(n4)O(n^{4}) time.

It takes O(n3)O(n^{3}) space and O(n3)O(n^{3}) time to compute M3M_{3} and then Jennrich’s algorithm can decompose the tensor in O(n3)O(n^{3}) space and O(n4)O(n^{4}) time. ∎

Learning the latent distribution

Since the variables HH are not observed, MixOracle(S)\mathsf{MixOracle}(S) only tells us the set

But the correspondence Ω∋h↔j∈[K]\Omega\ni h\leftrightarrow j\in[K] between a possible tuple hh of values of hidden variables and the corresponding mixture component is unknown.

Since the values of HH are not observed, we may learn this correspondence only up to a relabeling of Ωi\Omega_{i}. By definition, the input distribution has K=∣Ω∣K=|\Omega| mixture components over XX and ki=k(Xi)k_{i}=k(X_{i}) mixture components over XiX_{i}. Fix any enumeration of these components by [K][K] and [ki][k_{i}], respectively. To recover the correspondence Ω∋h↔j∈[K]\Omega\ni h\leftrightarrow j\in[K], we will need access to the map

defined so that [L(j)]i[L(j)]_{i} equals to the index of the mixture component C(X,j)C(X,j) (marginalized over XiX_{i}) in the marginal distribution over XiX_{i}. Crucially, this discussion establishes that LL can be computed from a combination of MixOracle(X)\mathsf{MixOracle}(X) and MixOracle(Xi)\mathsf{MixOracle}(X_{i}) for each ii.

The map LL encodes partial information about the causal structure in GG. Indeed, if h1,h2∈Ωh_{1},h_{2}\in\Omega are a pair of states of hidden variables HH that coincide on \pa(Xi)\pa(X_{i}) for some Xi∈XX_{i}\in X, then by the Markov property the components that correspond to h1h_{1} and h2h_{2} should have the same marginal distribution over XiX_{i}.

Consider the DAG on Figure 2. We do not make any assumptions about the causal structure between hidden variables. This DAG has 33 hidden variables, and we assume that each of them takes values in the set {0,1}\{0,1\}. Then by Assumption 2.4, every observed variable is a mixture of 44 components, while the distribution on XX is a mixture of 88 components. Note that the anchor word assumption is violated here, while (SSC) assumption is satisfied. The map L:→××L:\rightarrow\times\times for an example as in Fig. 2 has form

Our goal is to find the correspondence between h∈Ω={0,1}3h\in\Omega=\{0,1\}^{3} and i∈i\in. (The projection on the third variable is not shown on Figure 2, so the third coordinate of LL cannot be deduced from the plot.)

We now show that there is an algorithm that exactly recovers \prob(H)\prob(H) from the bipartite graph Γ\Gamma, the map L:[K]→[k1]×⋯×[kn]L:[K]\to[k_{1}]\times\cdots\times[k_{n}], and the mixture weights (probabilities) {π(X,i)∣i∈[K]}={\prob(Z=i)∣i∈[K]}\{\pi(X,i)\mid i\in[K]\}=\{\prob(Z=i)\mid i\in[K]\}. Each of these inputs can be computed from MixOracle\mathsf{MixOracle}.

Let JJ be an order-mm tensor whose ii-th mode is indexed by values of HiH_{i}, such that J(h1,h2,…,hm)=\prob(H=h)J(h_{1},h_{2},\ldots,h_{m})=\prob(H=h). That is, JJ is the joint probability table of HH.

Suppose Assumptions 2.4 and 3.1 hold. Then the correspondence Ω∋h↔C(X,i)\Omega\ni h\leftrightarrow C(X,i) and the tensor J(h1,h2,…,hm)=\prob(H=(h1,h2,…,hm))J(h_{1},h_{2},\ldots,h_{m})=\prob(H=(h_{1},h_{2},\ldots,h_{m})) can be efficiently reconstructed from LL, Γ\Gamma and {π(X,i)}i∈[K]\{\pi(X,i)\}_{i\in[K]}.

If Assumption 3.1 is violated, then in general JJ cannot be reconstructed uniquely and moreover, GG cannot be uniquely identified. See Appendix C for details.

Note that h∗h^{*} and eie_{i} differ in exactly one coordinate. We then repeat this process until all states have been exhausted. The following example illustrates the procedure and explains how Lemma C.1 helps to resolve the ambiguity regarding the assignment of components to hidden states in each step.

Consider the DAG GG in Fig. 2. It has 33 hidden variables, each of which takes values in {0,1}\{0,1\}. By Assumption 2.4 every observed variable is a mixture of 44 components, while the distribution on XX is a mixture of 88 components. Note that the anchor word assumption is violated here, while SSC (Assumption 3.1) is satisfied. The map L:→××L:\rightarrow\times\times can be written as:

We want to find the correspondence between h∈Ω={0,1}3h\in\Omega=\{0,1\}^{3} and i∈i\in.

We start by picking an arbitrary component, say 1, and assign it to (H1,H2,H3)=(0,0,0)(H_{1},H_{2},H_{3})=(0,0,0). Next, we make use of Lemma C.1. Since we know Γ\Gamma, we know ch⁡(Hi)\ch(H_{i}) for each ii. In particular, for the hidden variable H1H_{1}, we know ch⁡(H1)={X1,X2}\ch(H_{1})=\{X_{1},X_{2}\}. This implies that if H2,H3H_{2},H_{3} are fixed while H1H_{1} changes its value, then the component of X3X_{3} is unchanged. It follows that the third coordinate of LL is also unchanged. This gives us a way to pair up the components that have the same third coordinate L(i)3L(i)_{3}; the pairs are (1,6)(1,6), (2,4)(2,4), (3,7)(3,7) and (5,8)(5,8). By our previous observation, these pairs are in one-to-one correspondence with unique states of (H1,H2)=(h1,h2)(H_{1},H_{2})=(h_{1},h_{2}), and each pair identifies the pair of components (P(X ∣ H1=0,H2=h2,H3=h3),P(X ∣ H1=1,H2=h2,H3=h3))(P(X\,|\,H_{1}=0,H_{2}=h_{2},H_{3}=h_{3}),P(X\,|\,H_{1}=1,H_{2}=h_{2},H_{3}=h_{3})). Note that at this stage, there is still ambiguity as to which coordinate of each pair corresponds to which component.

Similarly, we can pair up the components that correspond to assignments of hidden variables that differ only in the value of H2H_{2}. The pairs are (1,3)(1,3), (2,5)(2,5), (4,8)(4,8) and (6,7)(6,7). Finally, for H3H_{3} the pairs are (1,5)(1,5), (2,3)(2,3), (4,7)(4,7) and (6,8)(6,8).

Since component 1 is assigned to (H1,H2,H3)=(0,0,0)(H_{1},H_{2},H_{3})=(0,0,0) we can deduce that

Assume that we know which components correspond to the hidden variable state (H1,H2,H3)=(h1,h2′,h3)(H_{1},H_{2},H_{3})=(h_{1},h_{2}^{\prime},h_{3}) and (H1,H2,H3)=(h1′,h2,h3)(H_{1},H_{2},H_{3})=(h_{1}^{\prime},h_{2},h_{3}), with h1≠h1′h_{1}\neq h_{1}^{\prime} and h2≠h2′h_{2}\neq h_{2}^{\prime}. Then we can use the information above to deduce which components correspond to the hidden state (h1′,h2′,h3)(h_{1}^{\prime},h_{2}^{\prime},h_{3}) since it differs from them in just 1 position. Hence, we can deduce

Note that since (1,1,1)(1,1,1) differs from the four states identified in the first step in two entries, this has not been determined yet. However, repeating this argument a third time we can deduce that component 4 corresponds to (H1,H2,H3)=(1,1,1)(H_{1},H_{2},H_{3})=(1,1,1).

To illustrate how this algorithm works in the case of non-binary latent variables we provide one more example.

Suppose that the map L:→×××L:\rightarrow\times\times\times is given by:

We want to find the correspondence between h∈Ω={0,1,2}2h\in\Omega=\{0,1,2\}^{2} and i∈i\in.

As in the previous example, in order to see which components correspond to the states of latent variables where H2H_{2} is fixed and H1H_{1} takes all values in {0,1,2}\{0,1,2\} we group together the components that have the same value of LL on X∖ch⁡(H1)={X4}X\setminus\ch(H_{1})=\{X_{4}\}. We get the following groups (1,7,8)(1,7,8), (2,4,6)(2,4,6) and (3,5,9)(3,5,9).

Similarly, by comparing the values of LL on X∖ch⁡(H2)={X2,X3}X\setminus\ch(H_{2})=\{X_{2},X_{3}\} we get that the following groups correspond to a fixed value of H1H_{1}, while H2H_{2} vary: (1,4,5)(1,4,5), (2,8,9)(2,8,9) and (3,6,7)(3,6,7).

Since values of HiH_{i} are determined up to relabeling we can arbitrarily assign a component, say 1, to (H1=0,H2=0)(H_{1}=0,H_{2}=0). Now, using Lemma C.1, we know that components that correspond to (H1=1,H2=0)(H_{1}=1,H_{2}=0) and (H1=2,H2=0)(H_{1}=2,H_{2}=0) are 77 and 88, and again because values of HiH_{i} can be relabeled, at this point the choice is arbitrary. Using the similar argument for H2H_{2}, we can deduce the following correspondence:

At this point the labeling of the values of hidden variables is fixed. Now let us consider an index of hamming weight 2, say (1,1)(1,1). We know that the component, that corresponds to this state of latent variables, differs from the component 44, that corresponds to (0,1)(0,1), only due to the change of H1H_{1}. Hence, the component that corresponds to (1,1)(1,1) is in the set {2,4,6}\{2,4,6\}. At the same time, we know that it differs from the component 77 that corresponds to (1,0)(1,0) only due to the change of H2H_{2}. Hence, the desired component is in the set {3,6,7}\{3,6,7\}. By taking the intersection of sets {2,4,6}\{2,4,6\} and {3,6,7}\{3,6,7\} we deduce that the value that corresponds to (1,1)(1,1) is 6. Similarly we can determine the rest of the values.

Implementation details

The results in Section 3 assume access to the mixture oracle MixOracle(S)\mathsf{MixOracle}(S). Of course, in practice, learning mixture models is a nontrivial problem. Fortunately, many algorithms exist for approximating this oracle: In our implementation, we used KK-means. A naïve application of clustering algorithms, however, ignores the significant structure between different subsets of observed variables. Thus, we also enforce internal consistency amongst these computations, which makes estimation much more robust in practice. In the remainder of this section, we describe the details of these computations; a complete outline of the entire pipeline can be found in Appendix E.

In order to estimate the number of components in a marginal distribution for a subset SS of observed variables with ∣S∣≤3|S|\leq 3, we use KK-means combined with agglomerative clustering to merge nearby cluster centers, and then select the number of components that has the highest silhouette score. Done independently, this step ignores the structure of the global mixture, and is not robust. In order to make learning more robust we observe that the assumptions on the distribution imply the following properties:

Divisibility condition: The number of components we expect to observe over a set SS of observed variables is divisible by a number of components we observe on the subset S′⊂SS^{\prime}\subset S of observed variables (see Obs. 2.7).

Structure of means: Observe that the projections of the means of mixture clusters in the marginal distribution over SS are the same as the means of mixture components over variables S′S^{\prime} for every S′⊆SS^{\prime}\subseteq S. Hence, if we learn the mixture models over SS and S′S^{\prime} with the correct numbers of components k(S)k(S) and k(S′)k(S^{\prime}), we expect the projections to be close.

Suppose we are confident that the number of components in the mixture over X1X_{1} is in the set {6,7,8}\{6,7,8\}, over X2X_{2} is in {4,5,6}\{4,5,6\} and the number of components in the mixture over {X1,X2}\{X_{1},X_{2}\} is in the set {20,21,22,23,24,25,26}\{20,21,22,23,24,25,26\}. Using divisibility condition between X1X_{1} and {X1,X2}\{X_{1},X_{2}\} we may shrink the set of candidates to {21,24}\{21,24\}. Next using the divisibility condition for X2X_{2} and {X1,X2}\{X_{1},X_{2}\} we may determine that the number of components should be 2424.

With these observations in mind, we use a weighted voting procedure, where every set SS votes for the number of components in every superset and every subset based on divisibility or means alignment. We then predict the true number of components by picking the candidate with the most votes.

Constructing LL

In order to estimate LL from samples we learn the mixture over the entire set of variables (using K-means and the number of components predicted on the previous step) and over each variable separately (again, using previous step). After this we project the mean of each component to a space over which XiX_{i} is defined and pick the closest mean in L2L_{2} distance (see Figure 2).

Reconstructing the latent graphical model

Once we obtain the joint probability table of HH, the final piece is to learn the latent DAG Λ\Lambda on HH. This is a standard problem of learning the causal structure among mm discrete variables given samples from their joint distribution. For this a multitude of approaches have been proposed in the literature, for instance the PC algorithm or the GES algorithm . In our experiments, we use the Fast Greedy Equivalence Search with the discrete BIC score, without assuming faithfulness. The final graph GG is therefore obtained from Γ\Gamma and Λ\Lambda.

Experiments

We implemented these algorithms in an end-to-end pipeline that inputs observed data and outputs an estimate of the causal graph GG and an estimate for the joint probability table \prob(H)\prob(H). To test this pipeline, we ran experiments on synthetic data. Full details about these experiments, including a detailed description of the entire pipeline, can be found in Appendix F.

We start with a causal DAG GG generated from the Erdös-Rényi model, for different settings of m,nm,n and ∣Ωi∣|\Omega_{i}|. We then generate samples from the probability distribution that corresponds to GG. We take each mixture component to be a Gaussian distribution with random mean and covariance (we do not force mixture components to be well-separated, aside from constraining the covariances to be small). Additionally, we do not impose restrictions on the weights of the components, which may be very small. As a result, it is common to have highly unbalanced clusters (e.g. we may have less than 3030 points in one component and over 10001000 in another). Figure 4 reports the results of 600600 simulations; 300300 each for N=10000N=10000 samples and N=15000N=15000 samples.

Results

To compare how well our model recovers the underlying DAG, we compute the Structural Hamming Distance (SHD) between our estimated DAG and the true DAG. Since GES returns a CPDAG instead of a DAG, we also report the number of correct but unoriented edges in the estimated DAG. The average SHD across different problems sizes ranged from zero to 1.331.33. The highest SHD for any single run was 66. For context, the simulated DAGs had between 33 and 2525 edges. Note that any errors are entirely due to estimation error in the KK-means implementation of MixOracle\mathsf{MixOracle}, which we expect can be improved significantly. In the supplement we also report on experiments with much smaller sample size N=1000N=1000 (Fig. 6). These results indicate that the proposed pipeline is surprisingly effective at recovering the causal graph.

Discussion

In this paper, we established general conditions under which the latent causal model GG is identifiable (Theorem 3.2). We show that these conditions are essentially necessary, and mostly amount to non-degeneracy conditions on the joint distribution. Under a linear independence condition on columns of the bipartite adjacency matrix of Γ\Gamma, we propose a polynomial time algorithm for recovering Γ\Gamma and \prob(H)\prob(H). Our algorithms work by reduction to the mixture oracle, which exists whenever the mixture model over XX, naturally induced by discrete latent variables, is identifiable. Experimental results show effectiveness of our approach. Even though identifiability of mixture models is a long-studied problem, a good mixture oracle implementation is a bottleneck for scalability of our approach. We believe that it may be improved significantly, and consider this as a promising future direction. In this paper, we work under the measurement model that does not allow direct causal relationships between observed variables. We believe that this condition may be relaxed and are eager to explore this direction in future work.

Acknowledgements

G.R. thanks Aravindan Vijayaraghavan for pointers to useful references. B.K. was partially supported by advisor László Babai’s NSF grant CCF 1718902. G.R. was partially supported by NSF grant CCF-1816372. P.R. was supported by NSF IIS-1955532. B.A. was supported by NSF IIS-1956330, NIH R01GM140467, and the Robert H. Topel Faculty Research Fund at the University of Chicago Booth School of Business.

References

Appendix A Non-identifiability if Assumption 2.4 is violated

In this appendix we are going to show that Assumptions 2.2 and 2.3 on the graph GG are not sufficient for identifiability, and therefore additional assumptions on the distribution of HH over Ω\Omega are required as well.

For distributions D1,D2D_{1},D_{2}, let D1⊗D2D_{1}\otimes D_{2} denote the product of the distributions D1D_{1} and D2D_{2}.

That is, if X∼D1X\sim D_{1} and Y∼D2Y\sim D_{2} are independent, then their joint distribution is D1⊗D2D_{1}\otimes D_{2}.

The following example illustrates an important case of non-identifiability and motivates the need for Assumption 2.4.

Let N0,N1,N0′,N1′N_{0},N_{1},N_{0}^{\prime},N_{1}^{\prime} be independent Gaussian distributions with distinct parameters (means and variances). Consider

We claim that (X1,X2)(X_{1},X_{2}) is consistent with (i.e., satisfies Markov property with respect to) each of the following three models below. Here, in the model S3S_{3} the hidden variable H1H_{1} can take three values {0,1,2}\{0,1,2\}, and in models AA and BB, hidden variables take values in {0,1}\{0,1\}.

H1<spanclass="katex−display"><spanclass="katex"><spanclass="katex−mathml"><mathxmlns="http://www.w3.org/1998/Math/MathML"display="block"><semantics><mrow><msub><mi>X</mi><mn>1</mn></msub></mrow><annotationencoding="application/x−tex">X1</annotation></semantics></math></span><spanclass="katex−html"aria−hidden="true"><spanclass="base"><spanclass="strut"style="height:0.8333em;vertical−align:−0.15em;"></span><spanclass="mord"><spanclass="mordmathnormal"style="margin−right:0.0785em;">X</span><spanclass="msupsub"><spanclass="vlist−tvlist−t2"><spanclass="vlist−r"><spanclass="vlist"style="height:0.3011em;"><spanstyle="top:−2.55em;margin−left:−0.0785em;margin−right:0.05em;"><spanclass="pstrut"style="height:2.7em;"></span><spanclass="sizingreset−size6size3mtight"><spanclass="mordmtight"><spanclass="mordmtight">1</span></span></span></span></span><spanclass="vlist−s">​</span></span><spanclass="vlist−r"><spanclass="vlist"style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span>H2H_{1}<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>X</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">X_{1}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span>H_{2}X2X_{2} Model AA H1<spanclass="katex−display"><spanclass="katex"><spanclass="katex−mathml"><mathxmlns="http://www.w3.org/1998/Math/MathML"display="block"><semantics><mrow><msub><mi>X</mi><mn>1</mn></msub></mrow><annotationencoding="application/x−tex">X1</annotation></semantics></math></span><spanclass="katex−html"aria−hidden="true"><spanclass="base"><spanclass="strut"style="height:0.8333em;vertical−align:−0.15em;"></span><spanclass="mord"><spanclass="mordmathnormal"style="margin−right:0.0785em;">X</span><spanclass="msupsub"><spanclass="vlist−tvlist−t2"><spanclass="vlist−r"><spanclass="vlist"style="height:0.3011em;"><spanstyle="top:−2.55em;margin−left:−0.0785em;margin−right:0.05em;"><spanclass="pstrut"style="height:2.7em;"></span><spanclass="sizingreset−size6size3mtight"><spanclass="mordmtight"><spanclass="mordmtight">1</span></span></span></span></span><spanclass="vlist−s">​</span></span><spanclass="vlist−r"><spanclass="vlist"style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span>H2H_{1}<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>X</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">X_{1}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span>H_{2}X2X_{2} Model BB X2<spanclass="katex−display"><spanclass="katex"><spanclass="katex−mathml"><mathxmlns="http://www.w3.org/1998/Math/MathML"display="block"><semantics><mrow><msub><mi>X</mi><mn>1</mn></msub></mrow><annotationencoding="application/x−tex">X1</annotation></semantics></math></span><spanclass="katex−html"aria−hidden="true"><spanclass="base"><spanclass="strut"style="height:0.8333em;vertical−align:−0.15em;"></span><spanclass="mord"><spanclass="mordmathnormal"style="margin−right:0.0785em;">X</span><spanclass="msupsub"><spanclass="vlist−tvlist−t2"><spanclass="vlist−r"><spanclass="vlist"style="height:0.3011em;"><spanstyle="top:−2.55em;margin−left:−0.0785em;margin−right:0.05em;"><spanclass="pstrut"style="height:2.7em;"></span><spanclass="sizingreset−size6size3mtight"><spanclass="mordmtight"><spanclass="mordmtight">1</span></span></span></span></span><spanclass="vlist−s">​</span></span><spanclass="vlist−r"><spanclass="vlist"style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span>H1X_{2}<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>X</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">X_{1}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.0785em;">X</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0785em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span></span>H_{1} Model S3S_{3} Note that all these models satisfy “no-twins” Assumption 2.2 and minimality Assumption 2.3, while Assumptions 2.4 are violated by models AA and BB.

Consistency with S3S_{3}. Let H1H_{1} be a random variable that takes values 0,1,20,1,2 with probabilities (1/2,1/4,1/4)(1/2,1/4,1/4). Then

Consistency with AA. Let H1H_{1} and H2H_{2} be i.i.d random variables that take values 0,10,1 with probabilities (1/2,1/2)(1/2,1/2). Then

Consistency with BB. Let H1H_{1} be a random variable that takes values 0,1{0,1} with probabilities (1/2,1/2)(1/2,1/2). Let H2H_{2} be a dependent random variable that takes values 0,10,1 with probabilities (1,0)(1,0), if H1=0H_{1}=0, and with probabilities (1/2,1/2)(1/2,1/2), if H1=1H_{1}=1.

Observe that among the models A,BA,B and S3S_{3}, only S3S_{3} satisfies Assumption 2.4. Observe that the model AA satisfies part (a), but not (b), and the model BB satisfies part (b), but not (a), of Assumption 2.4. This shows that only one of these assumptions is still not sufficient for identifiability of a latent causal model.

Appendix B Reconstructing bipartite part Γ\Gamma. Proofs for Sections 4

Recall that (cf. Section 4.2), that for w(Hi)=log⁡(dim⁡(Hi))w(H_{i})=\log(\dim(H_{i})) and every subset S⊆XS\subseteq X the parameters of the latent DAG satisfy

Recall also the definitions of \com\com and \comW\comW in (5), reproduced here for ease of reference:

We start our discussion of the proof of results in Section 4 by reducing learning of the causal graph Γ\Gamma to a more general learning problem.

Let Γ=(X∪H,E)\Gamma=(X\cup H,E) be a (not necessarily directed) bipartite graph on parts XX and HH, and let w:H→(0,∞)w:H\rightarrow(0,\infty) be an arbitrary function that defines weights of variables in HH.

Recall that for a weight function ww and subset S⊆XS\subseteq X we define

Assume that the vertices in HH and the weight function ww are unknown.

Input: Values (WΓ(S)∣S∈F)(W_{\Gamma}(S)\mid S\in\mathcal{F}) indexed by a family of known subsets F⊆2X\mathcal{F}\subseteq 2^{X}

Goal: Reconstruct the number of unknown vertices HH, the graph Γ\Gamma between HH and XX (up to an isomorphism), and the weight function ww from the input.

Whether it is possible to reconstruct Γ\Gamma and ww from the input may depend on the family F\mathcal{F} or some additional assumptions about the structure of the graph Γ\Gamma. To account for weights ww, we slightly modify Definition 4.1 as follows:

We say that (Γ,w)(\Gamma,w) is F\mathcal{F}-recoverable if (Γ,w)(\Gamma,w) can be uniquely recovered from XX and the sequence (WΓ(S)∣S∈F)(W_{\Gamma}(S)\mid S\in\mathcal{F}).

In the sequel, we use this modified definition.

The most natural regime is when F\mathcal{F} contains the sets whose size is bounded:

We say that (Γ,w)(\Gamma,w) is tt-recoverable if (Γ,w)(\Gamma,w) is (X≤t)\binom{X}{\leq t}-recoverable, where (X≤t)\binom{X}{\leq t} denotes the collection of subsets of XX of size at most tt.

B.2 Reconstructing Γ\Gamma with full information about WW

In this section we study Problem B.1, when full information about WΓ(⋅)W_{\Gamma}(\cdot) is provided, i.e. F=2X\mathcal{F}=2^{X}.

Although the algorithm considered here will have exponential in ∣X∣|X| runtime, it sheds light on the minimal theoretical assumptions we need for proving identifiability of Γ\Gamma. We will consider more efficient algorithms in later sections.

We start by proving Observation 4.3, which notes that if \nbhdΓ(Hi)=\nbhdΓ(Hj)\nbhd_{\Gamma}(H_{i})=\nbhd_{\Gamma}(H_{j}) for Hi≠HjH_{i}\neq H_{j}, then (Γ,w)(\Gamma,w) is not 2X2^{X}-recoverable.

Consider the graph Γ′\Gamma^{\prime} obtained from Γ\Gamma by replacing H1H_{1} and H2H_{2} with a single variable H∗H^{*} and by connecting H∗H^{*} by an edge to all vertices in XX that are adjacent with H1H_{1} or H2H_{2} in Γ\Gamma. Define w(H∗)=w(H1)+w(H2)w(H^{*})=w(H_{1})+w(H_{2}). Then WΓ(S)=WΓ′(S)W_{\Gamma}(S)=W_{\Gamma^{\prime}}(S) for any S⊆XS\subseteq X. ∎

Let F⊆2X\mathcal{F}\subseteq 2^{X}. If there is a pair of distinct variables Hi,Hj∈HH_{i},H_{j}\in H such that \nbhdΓ(H1)=\nbhdΓ(H2)\nbhd_{\Gamma}(H_{1})=\nbhd_{\Gamma}(H_{2}), then (Γ,w)(\Gamma,w) is not F\mathcal{F}-recoverable.

We now prove that in the case F=2X\mathcal{F}=2^{X}, this is the only obstacle. We start by showing that certain neighborhoods of hidden variables can be identified using \comW(⋅)\comW(\cdot).

As explained in Section 4.2, in the case when \nbhd(Hi)⊄\nbhd(Hj)\nbhd(H_{i})\not\subset\nbhd(H_{j}) for all HjH_{j}, we expect \comW(⋅)\comW(\cdot) to have a clear “signature” of HiH_{i}. We make this intuition precise in the definition and lemma that follows.

We say that a set SS of observed variables XX is a maximal neighborhood block if \comW(S)≠0\comW(S)\neq 0, but for any superset S′S^{\prime} of SS we have \comW(S′)=0\comW(S^{\prime})=0.

A set S⊆XS\subseteq X is a maximal neighborhood block if and only if there exists a hidden vertex Hi∈HH_{i}\in H such that \nbhdΓ(Hi)=S\nbhd_{\Gamma}(H_{i})=S and for any other Hj∈HH_{j}\in H we have S⊈\nbhdΓ(Hj)S\not\subseteq\nbhd_{\Gamma}(H_{j}).

Assume that S⊆XS\subseteq X is a maximal neighborhood block. Since \comW(S)>0\comW(S)>0 the set of common neighbours \comΓ(S)\com_{\Gamma}(S) is non-empty. If \comΓ(S)\com_{\Gamma}(S) contains a hidden vertex HjH_{j} that is connected to a vertex x∉Sx\notin S then, Hj∈\comΓ(S∪{x})H_{j}\in\com_{\Gamma}(S\cup\{x\}), and \comWΓ(S∪{x})≥w(Hj)>0\comW_{\Gamma}(S\cup\{x\})\geq w(H_{j})>0 which contradicts the assumption that SS is a maximal neighborhood block. Therefore, for every HjH_{j} in \comΓ(S)\com_{\Gamma}(S), we have \nbhdΓ(Hj)⊂S\nbhd_{\Gamma}(H_{j})\subset S. Therefore, there exists a variable HiH_{i} such that \nbhdΓ(Hi)=S\nbhd_{\Gamma}(H_{i})=S and for any other Hj∈HH_{j}\in H we have S⊈\nbhdΓ(Hj)S\not\subseteq\nbhd_{\Gamma}(H_{j}).

The opposite implication can be verified in a similar way. ∎

Let Γ\Gamma be a bipartite graph with parts XX and HH. Assume that no pair of vertices in HH has the same set of neighbours (in XX). Then Γ\Gamma is 2X2^{X}-recoverable.

We prove the claim of the theorem by induction on ∣H∣|H|. The statement for the base case ∣H∣=0|H|=0 immediately follows from the fact that W(S)=0W(S)=0 for all v∈Xv\in X if and only if ∣H∣=0|H|=0 since w(⋅)>0w(\cdot)>0. Assume that we proved the claim for all Γ\Gamma with ∣H∣=t|H|=t that satisfy the assumptions of the theorem. Let Γ\Gamma be a graph with ∣H∣=t+1|H|=t+1 that satisfies the assumptions of the theorem.

Using Lemma 4.6, compute values \comWΓ(S)\comW_{\Gamma}(S) for every S⊆XS\subseteq X. Using values of \comW(⋅)\comW(\cdot) we can find a maximal neighborhood block Y⊆XY\subseteq X. By Lemma B.6, there exists a hidden vertex HiH_{i} such that {Hi}=\comΓ(Y)\{H_{i}\}=\com_{\Gamma}(Y). Note that w(Hi)=\comW(Y)w(H_{i})=\comW(Y).

Denote by Γ′\Gamma^{\prime} the graph obtained from Γ\Gamma by deleting HiH_{i}.

Now we verify that Γ′\Gamma^{\prime} satisfies the assumptions of the theorem. There is nothing to check if the set of hidden vertices of Γ′\Gamma^{\prime} is empty. Assume that Γ′\Gamma^{\prime} has a non-empty set of hidden vertices. First, note that all hidden vertices in Γ′\Gamma^{\prime} still have distinct sets of neighbors. Second, note that (cf. (11)) WΓ′(S)=WΓ(S)W_{\Gamma^{\prime}}(S)=W_{\Gamma}(S) if S∩Y=∅S\cap Y=\emptyset (i.e. Hi∉\nbhdΓ(S)H_{i}\notin\nbhd_{\Gamma}(S)), and

if S∩YS\cap Y is not empty. Thus, we can compute WΓ′W_{\Gamma^{\prime}} from the values of WΓW_{\Gamma}.

By the induction hypothesis (Γ′,w∣Γ′)(\Gamma^{\prime},w|_{\Gamma^{\prime}}) is uniquely recoverable from WΓ′(S)W_{\Gamma^{\prime}}(S). Let Γ∗\Gamma^{*} be the graph obtained from Γ′\Gamma^{\prime} by adding a new variable HYH_{Y} of weight \comWΓ(Y)\comW_{\Gamma}(Y) and edges between HYH_{Y} and YY. Then Γ∗\Gamma^{*} is isomorphic to Γ\Gamma, and so Γ\Gamma is 2X2^{X}-recoverable. ∎

B.3 Efficient tt-recovery of Γ\Gamma for t≥3t\geq 3

The approach proposed in Appendix B.2 is exponential in the number of observed variables in the worst case, since we need to compute the scores of all subsets of XX. In this section, we show that with a mild additional assumption, there is an efficient algorithm to learn the bipartite graph between hidden and observed variables.

As before, let Γ=(X∪H,E)\Gamma=(X\cup H,E) be the bipartite graph between hidden and observed variables.

Recall, that we defined AA to be the ∣X∣×∣H∣|X|\times|H| adjacency matrix of Γ\Gamma (with 0,10,1 entries) and aia_{i} to denote the ii-th column of AA.

For a sequence of indices I=(i1,i2,…,it)⊆[n]I=(i_{1},i_{2},\ldots,i_{t})\subseteq[n] define

Recall, that as pointed out in Remark 4.7, for any S⊆XS\subseteq X with ∣S∣≤t|S|\leq t the value \comWΓ(S)\comW_{\Gamma}(S) can be computed from the {WΓ(S)∣S⊆X, ∣S∣≤t}\{W_{\Gamma}(S)\mid S\subseteq X,\ |S|\leq t\} using Lemma 4.6. Therefore, we can make the following observation.

All entries of the the tensor Mt=∑j∈Hw(j)(aj⊗aj⊗…⊗aj⏟t)M_{t}=\sum\limits_{j\in H}w(j)(\underbrace{a_{j}\otimes a_{j}\otimes\ldots\otimes a_{j}}_{t}) can be computed as Mt(I)=\comWΓ(I)M_{t}(I)=\comW_{\Gamma}(I) in O(2tnt)O(2^{t}n^{t}) time and space assuming access to {WΓ(S)∣S⊆X, ∣S∣≤t}\{W_{\Gamma}(S)\mid S\subseteq X,\ |S|\leq t\}.

For fixed tt this is a poly-time computation. Furthermore, in the settings we consider in Secrion 4 the values of WΓW_{\Gamma} can be computed from MixOracle\mathsf{MixOracle} using Observation 2.7.

Now we want to recover the vectors aja_{j} from MtM_{t}. Since aja_{j} are the columns of the adjacency matrix of Γ\Gamma this is equivalent to recovering the adjacency matrix of Γ\Gamma or Γ\Gamma itself up to an isomorphism.

For an order-tt tensor MtM_{t} its rank is defined as the smallest rr such that MtM_{t} can be written as

Such decomposition of MM with precisely rr components is called a minimum rank decomposition or a CP-decomposition.

is the unique minimum rank decomposition, then (Γ,w)(\Gamma,w) is tt-recoverable.

In order to recover Γ\Gamma and ww we compute MtM_{t} using {WΓ(S)∣S⊆X, ∣S∣≤t}\{W_{\Gamma}(S)\mid S\subseteq X,\ |S|\leq t\}. Then aja_{j} and w(j)w(j) can be uniquely (up to permutation) identified from minimum rank decomposition of MM. ∎

The following simplified version of Kruskal’s condition was proposed by Lovitz and Petrov.

be a set of mm rank-1 (product) tensors. For a subset S⊆[m]S\subseteq[m] with ∣S∣≥2|S|\geq 2 and j∈[t]j\in[t] define

If 2∣S∣≤∑i=1t(di(S)−1)+12|S|\leq\sum\limits_{i=1}^{t}(d_{i}(S)-1)+1 for every such SS, then

constitutes a unique minimal rank decomposition.

In our settings the sufficient condition for having the unique minimal rank decomposition takes the following form.

Assume that for every S⊆HS\subseteq H with ∣S∣≥2|S|\geq 2 we have

then the decomposition Mt=∑j∈Hw(j)aj⊗aj⊗…⊗aj⏟tM_{t}=\sum\limits_{j\in H}w(j)\underbrace{a_{j}\otimes a_{j}\otimes\ldots\otimes a_{j}}_{t} is the unique minimum rank decomposition and so (Γ,w)(\Gamma,w) is tt-recoverable.

Follows by combining Corollary B.12 and Lemma B.10. ∎

Learning the components of the minimum rank decomposition is a very well-studied problem for which a variety of algorithms have been proposed in the literature (see the survey or the book ). We can use Jennrich’s algorithm (see also and the references therein) as an efficient algorithm with guarantees:

Assume that the components of the tensor T=∑i=1rai⊗bi⊗ci\mathcal{T}=\sum\limits_{i=1}^{r}a_{i}\otimes b_{i}\otimes c_{i} satisfy the following conditions. The vectors {ai∣i∈[r]}\{a_{i}\mid i\in[r]\} are linearly independent, the vectors {bi∣i∈[r]}\{b_{i}\mid i\in[r]\} are linearly independent, and no pair of vectors cic_{i}, cjc_{j} is linearly dependent for i≠ji\neq j. Then the components of the tensor can be uniquely recovered in O(n3)O(n^{3}) space and O(n4)O(n^{4}) time.

Note that if all vectors aia_{i} are linearly independent, then the assumptions of Corollary B.12 are satisfied.

A similar problem for tt-recovery (for weighted hypergraphs) arose in a completely different context . While in both papers the problem is reduced to recovering the minimum rank decomposition of a carefully constructed tensor, we give better recovery guarantees for this problem by using more recent uniqueness guarantees .

Appendix C Reconstruction of the probability distribution on HH. Proofs for Section 5

In this section we discuss how one may reconstruct the hidden probability distribution on \prob(H)\prob(H) from

the function L:[K]→[k1]×⋯×[kn]L:[K]\to[k_{1}]\times\cdots\times[k_{n}], and

the mixture weights (probabilities) {π(X,i)∣i∈[k(X)]}={\prob(Z=i)∣i∈[k(X)]}\{\pi(X,i)\mid i\in[k(X)]\}=\{\prob(Z=i)\mid i\in[k(X)]\}

Below we formulate the key lemma that allows us to relate the structure present in the map LL with the causal structure in GG.

Given a state H=(h1,…,hm)H=(h_{1},\ldots,h_{m}) and its corresponding component P(X ∣ H1=h1,…,Hm=hm)P(X\,|\,H_{1}=h_{1},\ldots,H_{m}=h_{m}), we want to identify the components P(X ∣ H1=h1′,H2=h2,…,Hm=hm)P(X\,|\,H_{1}=h_{1}^{\prime},H_{2}=h_{2},\ldots,H_{m}=h_{m}) that result from changing just the first hidden variable while keeping every other hidden variable fixed. The next lemma says that we can identify such components by looking into the distribution of the observed variables that are not children of H1H_{1}.

Let HiH_{i} be a hidden variable and let C(X∖\nbhdΓ(Hi),j)C({X\setminus\nbhd_{\Gamma}(H_{i})},j) be an arbitrary mixture component observed in a marginal mixture distribution over the variables in X∖\nbhdΓ(Hi)X\setminus\nbhd_{\Gamma}(H_{i}). Let C(j1),C(j2),…C(jt)C(j_{1}),C(j_{2}),\ldots C(j_{t}) be all the mixture components in the distribution of XX whose marginal distribution over X∖\nbhdΓ(Hi)X\setminus\nbhd_{\Gamma}(H_{i}) is equal to C(X∖\nbhdΓ(Hi),j)C({X\setminus\nbhd_{\Gamma}(H_{i})},j). In other words, L(js)i=jL(j_{s})_{i}=j for all s∈[t]s\in[t]. Then t=dim⁡(Hi)t=\dim(H_{i}) and every C(js)C(j_{s}) for s∈[t]s\in[t] corresponds to a distinct value of HiH_{i}.

Observe that Assumption 3.1 implies that \nbhdΓ(X∖\nbhdΓ(Hi))=H∖{Hi}\nbhd_{\Gamma}(X\setminus\nbhd_{\Gamma}(H_{i}))=H\setminus\{H_{i}\}. Therefore, by Assumption 2.4(b), p(X∖\nbhdΓ(Hi)∣H=h1)∼p(X∖\nbhdΓ(Hi)∣H=h2)p(X\setminus\nbhd_{\Gamma}(H_{i})\mid H=h_{1})\sim p(X\setminus\nbhd_{\Gamma}(H_{i})\mid H=h_{2}), if and only if h1h_{1} and h2h_{2} differ only in the value of HiH_{i}. ∎

C.2 Proof of Theorem 5.4

The algorithm described in the previous examples can be used to prove Theorem 5.4. For this, we present a general algorithm to recover the correspondence Ω∋h↔i∈[K]\Omega\ni h\leftrightarrow i\in[K] using Lemma C.1.

Without loss of generality, we may assume that HiH_{i} takes values from Ωi={0,1,…,dim⁡(Hi)−1}\Omega_{i}=\{0,1,\ldots,\dim(H_{i})-1\} for every ii.

Recall that the Hamming weight of a vector is the number of non-zero coordinates of this vector. Denote by Ω(t)\Omega^{(t)} the set of elements of Ω=Ω1×Ω2×…×Ωk\Omega=\Omega_{1}\times\Omega_{2}\times\ldots\times\Omega_{k} of the Hamming weight at most tt.

We start by recovering the entries of the tensor that correspond to the indicies in Ω(1)\Omega^{(1)}.

Let us pick an arbitrary mixture component CC that participates in the observed mixture model and let us put it in correspondence to h=(0,0,…0)h=(0,0,\ldots 0). We assign the probability of observing CC to the cell J(0,0,…,0)J(0,0,\ldots,0).

Take any i∈[m]i\in[m]. Consider the set of d(Hi)d(H_{i}) mixture components {Ci,a∣a∈Ωi}\{C_{i,a}\mid a\in\Omega_{i}\}, guaranteed by Lemma C.1, that have the same distribution as CC in coordinates X∖ch⁡(Hi)X\setminus\ch(H_{i}) (here we take arbitrary indexing by aa). Assign Ci,aC_{i,a} to the vector hi,a∈Ω(1)h_{i,a}\in\Omega^{(1)} of Hamming weight 1, that has unique non-zero value aa in coordinate ii. And let J(hi,a)J(h_{i,a}) be the probability of observing Ci,aC_{i,a}.

Next, we claim that the (valid) correspondence Ω∋h↔i∈[K]\Omega\ni h\leftrightarrow i\in[K] for h∈Ω(t)h\in\Omega^{(t)} can be uniquely extended to the (valid) correspondence Ω∋h↔i∈[K]\Omega\ni h\leftrightarrow i\in[K] for h∈Ω(t+1)h\in\Omega^{(t+1)} for any t=1,…,m−1t=1,\ldots,m-1.

Indeed, let h∈Ω(t+1)h\in\Omega^{(t+1)} and let ii and jj be a pair of distinct non-zero coordinates of hh. Let hih_{i} and hjh_{j} be the vectors obtained by changing the ii-th and jj-th coordinates of hh to 0. Let CiC_{i} and CjC_{j} be the mixture components that correspond to hih_{i} and hjh_{j}.

Using Lemma C.1, for s∈{i,j}s\in\{i,j\} we can find a set MuM_{u} of dim⁡(Hu)\dim(H_{u}) mixture components that are equally distributed with CsC_{s} over X∖\nbhdΓ(Hs)X\setminus\nbhd_{\Gamma}(H_{s}). We put into correspondence with hh the unique component in the intersection of MiM_{i} and MjM_{j}. We define J(h)J(h) to be the probability of observing this component. ∎

Next we show that our algorithm works in time that is almost linear in the output size (recall that K≥2mK\geq 2^{m} and KK is the size of the output).

The algorithm described in Theorem 5.4 works in O((nm+max⁡iki)K)O((nm+\max_{i}k_{i})K) time.

First, the algorithm in Theorem 5.4 computes the equivalence classes of components that correspond to states of latent variables that differ just in the value of HjH_{j}. Having access to Γ\Gamma and LL, computing these equivalence classes takes at most O(nmK)O(nmK) time (for each of the mm hidden variables we need to compare vectors of values of LL of length nn for KK components).

Once these equivalence classes are computed, the algorithm in Theorem 5.4 sequentially fills in the joint probability table. If the entries with indices of Hamming weight tt are filled in, in order to determine the value of a cell with an index of hamming weight t+1t+1, we explore at most 2max⁡i∈[m]ki2\max_{i\in[m]}k_{i} elements of the corresponding equivalence classes. Since eventually we explore all KK cells of the joint probability table, the total runtime of this phase is bounded by O(max⁡i∈[m]ki)KO(\max_{i\in[m]}k_{i})K. ∎

C.3 Non-identifiability if Assumption 3.1 is violated

Finally, we prove the impossibility claim in Remark 5.5.

We claim that if Assumption 3.1 is violated, then \prob(H)\prob(H) cannot be recovered and moreover GG is not identifiable. Consider a pair of models on Figure 5, where variables H1H_{1} and H2H_{2} are binary, i.e., they take values {0,1}\{0,1\}. Let N0,N1,N2,N3N_{0},N_{1},N_{2},N_{3} and N0′,N1′N_{0}^{\prime},N_{1}^{\prime} be independent Gaussian distributions with distinct means and variances.

Suppose that the observed distribution is equal to

Now we show that this distribution can be realized by both models A and B.

Consistency with A. Let H1,H2H_{1},H_{2} be independent random variables that take values {0,1}\{0,1\} with probabilities (1/3,2/3)(1/3,2/3).

Consistency with B. Let H1,H2H_{1},H_{2} be binary random variables with the following distribution

Define components of the mixture distribution to be

Since both models AA and BB realize distribution \prob(X)\prob(X), we get that GG and \prob(H)\prob(H) are not identifiable. Observe that Assumption 3.1 is not satisfied for both AA and BB, while Assumptions 2.2, 2.3 and 2.4 are satisfied for each of AA and BB. ∎

Appendix D Proof of Theorem 3.2

Finally, we collect our results into a proof of the main theorem.

Suppose that Assumptions 2.2, 2.3 and 2.4 hold, then by Theorem 4.2(a), Γ\Gamma and dim⁡(Hi)\dim(H_{i}), for all ii, can be recovered from \prob(X)\prob(X). If additionally, the columns of the ∣X∣×∣H∣|X|\times|H| adjacency matrix AA are linearly independent, then by Theorem 4.8 (see Corollary B.12, Theorem B.13 and Observation B.8), Γ\Gamma and dim⁡(Hi)\dim(H_{i}), for all ii, can be reconstructed efficiently in O(n4)O(n^{4}) time.

Now, suppose that Assumption 3.1 holds. We can extract the map LL from the MixOracle\mathsf{MixOracle} (by taking appropriate projections of component distributions). Therefore, since we have Γ\Gamma, dim⁡(Hi)\dim(H_{i}), {π(X,i)}i∈[K]\{\pi(X,i)\}_{i\in[K]} and LL, by Theorem 5.4 and Observation C.2, we can reconstruct \prob(H)\prob(H) efficiently. ∎

Appendix E Algorithms

In this section we describe the full pipeline The code used to run the experiments can be found at https://github.com/30bohdan/latent-dag for learning GG from samples of the observed data XX. As input we receive a set of samples and as output we return an estimated causal graph GG and a joint probability distribution over HH. The pipeline consists of the following blocks:

Learning number of components. Estimates the number of components for all subsets of observed variables of size at most 3.

Input: Samples from the distribution \prob(X)\prob(X)

Output: Estimated number of mixture components k(S)k(S) in \prob(S)\prob(S) for all S⊆XS\subseteq X, ∣S∣≤3|S|\leq 3.

Reconstruction of the bipartite graph. Implements the algorithm of Theorem 4.8 for learning the bipartite causal graph Γ\Gamma.

Input: The number of mixture components k(S)k(S) in \prob(S)\prob(S) for all S⊆XS\subseteq X, ∣S∣≤3|S|\leq 3.

Output: Estimated bipartite graph Γ\Gamma and sizes of the domains of hidden variables dim⁡(Hi)\dim(H_{i}).

Input: Samples from the distribution \prob(X)\prob(X) and the numbers of components k(X)k(X) and k(Xi)k(X_{i}) for every i∈[n]i\in[n].

Learning the distribution \prob(H)\prob(H). In this step we implement the algorithm described in Theorem 5.4, see also Algorithm 1.

Input: LL, Γ\Gamma and dim⁡(Hi)\dim(H_{i}) for all i∈[m]i\in[m] and weights π(X,j)\pi(X,j) of k(X)k(X) mixture components.

Output: Estimated joint probability table of \prob(H)\prob(H).

We take LL, Γ\Gamma and dim⁡(Hi)\dim(H_{i}) for all ii as an input and return the joint probability table for \prob(H)\prob(H) as an output.

Learning latent DAG Λ\Lambda. In this step we estimate the causal graph over latent variables.

Input: The joint probability table of \prob(H)\prob(H).

Output: Estimated causal graph Λ\Lambda over HH.

In this paper, we prove theoretical guarantees for Steps (b) and (d), which invoke the mixture oracle MixOracle\mathsf{MixOracle}{}. Step (a) implements MixOracle\mathsf{MixOracle}, and Steps (c) and (e) are intermediate steps of the pipeline. As long as the oracle is correct, Step (c) is guaranteed to output the correct graph. The correctness of Step (e) depends on the structure learning algorithm used. A nice feature of our algorithm is its modularity, if a better algorithm is developed for one of the steps, it can be incorporated without influencing other parts.

Below we discuss various implementation details for these steps.

Our implementation of Step (a) uses the following strategy.

We estimate the upper bound kmaxk_{max} on the number of components involved in the mixtures of single variables (this can be done using the silhouette score).

For every observed variable XiX_{i} we train KK-means clustering with k=kmaxk=k_{max}. After this, we perform agglomerative clustering for every t∈[2,kmax]t\in[2,k_{max}], and record the silhouette score for every tt. We pick 55 values of tt with the best silhouette score.

We use the divisibility condition to compute the sets SXi,XjS_{X_{i},X_{j}} of possible numbers of components we expect to see over the pairs of variables Xi,XjX_{i},X_{j}. We use the best 5 predictions from the previous step for every variable XiX_{i} and include the candidate for the number of components into SXi,XjS_{X_{i},X_{j}} if it is divisible by one of the top-5 candidates for XiX_{i} and for XjX_{j}. This step is mainly needed for computational purposes in order to restrict the number of candidates for the number of components observed over the pairs of variables.

Next we learn the mixture of kk components for every k∈SXi,Xjk\in S_{X_{i},X_{j}} over the pairs (Xi,Xj)(X_{i},X_{j}) of observed variables. Similarly as in 2., we train KK-means for the largest candidate and perform agglomerative clustering after that.

We use divisibility and means voting (discussed in Sec. 6) to decide the best number of components for the single variables and the pairs of variables. In order to do this we make the predicted numbers of components for a pair Xi,(Xi,Xj)X_{i},(X_{i},X_{j}) to vote for each other if they satisfy the divisibility or means projection condition. We count the vote with the weight proportional to the silhouette score of the predicted number of components. For every XiX_{i}, and every pair (Xi,Xj)(X_{i},X_{j}), we take the component with the largest amount of votes as our best prediction.

We use means of the components predicted for pairs of variables (Xi,Xj)(X_{i},X_{j}) to estimate the locations of the means for the triples of observed variables. Instead of using KK-means with the fresh start we initialize it with predicted locations. This improves the running time. We use KK-means and silhouette score to predict the number of components for the triples of observed variables.

Details of Step (b):

In this step we use Corollary 4.4, Eq. (7) and Lemma 4.6 to compute entries of the tensor M3M_{3} using the output of Step (a). After this we apply Jennrich’s algorithm to learn the components of the tensor. As discussed in Appendix B.3 this is sufficient to reconstruct Γ\Gamma and dim⁡(Hi)\dim(H_{i}). In case Jennrich’s algorithm did not successfully execute due to numerical issues, alternating least squares (ALS) was used as a failsafe. In this case, the number of hidden variables mm was used as input. This can easily be avoided by running ALS for multiple values of mm and choosing the best fit. Since this issue arose in only a minority of cases, we did not implement this feature.

Details of Step (c):

We use Γ\Gamma and dim⁡(Hi)\dim(H_{i}) to compute the number of components we expect to observe in \prob(Xi)\prob(X_{i}) for every observed variable XiX_{i} and the number of components in the distribution \prob(X)\prob(X) over the entire set of observed variables. After this we use KK-means to learn the components in the mixture distribution over every variable XiX_{i} and over the entire set of observed variables. For every ii, and for every mixture component of \prob(X)\prob(X), we project its mean into the subspace over which XiX_{i} is defined. We use the closest in L2L_{2} distance mean of the components in \prob(Xi)\prob(X_{i}) as a prediction for the projected component.

Details of Step (d):

We implement the algorithm described in Theorem 5.4. See Algorithm 1 for details.

Details of Step (e):

Once we obtain the estimated joint probability table, we run the Fast Greedy Equivalence Search to learn the edges of the Latent graph HH, where we used the Discrete BIC score. FGES returns a CPDAG by default, so some edges may be undirected. We accordingly report both the Structural Hamming Distance (SHD) and the Unoriented Correct Edges (UCE) as metrics for our experiments. We remark that this step may be improved by using other algorithms such as PC or other scores, which is an interesting direction for future work.

Appendix F Experiment details

For each experiment, the data generation process was as follows:

(m,n)(m,n): Chosen from among (1,3),(2,5),(3,7),(3,8),(4,7),(4,8)(1,3),(2,5),(3,7),(3,8),(4,7),(4,8) in the ratio 1:2:2:3:1:11:2:2:3:1:1

Domain sizes ∣Ωi∣|\Omega_{i}|: Sampled from {2,3,4,5,6}\{2,3,4,5,6\}. If ∣Ω∣=∣Ω1∣…∣Ωm∣>50|\Omega|=|\Omega_{1}|\ldots|\Omega_{m}|>50, we skip the experiment.

Λ\Lambda: Choose an arbitrary topological order uniformly at random and sample each directed edge independently with probability 0.60.6.

Γ\Gamma: Sample each directed edge from HH to XX with probability 0.50.5. Enforce assumption 3.1 and linear independence of the columns aja_{j} of the adjacency matrix AA.

Samples: We generate samples from the mixture components generated on the previous step with probabilities defined by \prob(H)\prob(H).

We do not enforce minimum probability sizes or cluster sizes. As a result, the data generating process is likely to generate models which are extremely difficult to learn (e.g. if a randomly generated probability is very small, a mixture component will have few samples, which makes learning difficult). As a result, some random configurations may fail. We ran a total of 724724 experiments; out of these, 8.3%8.3\% failed in the oracle learning phase and another 8.8%8.8\% failed to produce a graph because of very high domain sizes or unfeasible LL. In the cases when the Jennrich algorithm failed due to numerical issues, this was caught and replaced with ALS for practical purposes as described in Step (b) above. These errors are conveniently caught during runtime and can be attributed to either the data generation process or the finite sample size as described above. Fig. 4 reports the metrics for the remaining 600600 experiments: 300300 experiments each for N=10000N=10000 samples and N=15000N=15000 samples. The experiments were run on a single node of an internal cluster.

Experiments with smaller sample size.

The number of samples in the experiments discussed above is chosen so that every cluster component has approximately 2020 samples. We also explored the behaviour of our algorithms when the number of samples is much smaller. We ran a total of 136 experiments for N=1000N=1000 samples, with (m,n)(m,n) chosen from (1,3),(2,5),(3,7),(4,7),(3,8)(1,3),(2,5),(3,7),(4,7),(3,8) in proportion 1 : 2 : 1 : 1 : 1. Out of these, 4.4%4.4\% failed in the oracle learning phase and another 8.8%8.8\% failed to produce a graph because of very high domain sizes or unfeasible LL. Furthermore, out of all failures, 25%25\% happen for (m,n)=(4,7)(m,n)=(4,7) and other 37.5%37.5\% happen for (m,n)=(3,8)(m,n)=(3,8). We report the metrics on Fig. 6.

We mention, that with N=1000N=1000 samples, we were able to recover HH and Ω\Omega even in the cases when several latent states had fewer than five observations. Also, for comparison, to give an example where we were not able to recover HH and Ω\Omega exactly: the mixture model had 48 components with 1, 2, 2, 3, 3, 5, 5, 5, 6 …, 53, 55 samples per component. This is clearly an extremely challenging setup: Some states had only a few observations and the true number of components is unknown to the procedure.

Choice of parameters for learning Λ\Lambda.

Once we have recovered the estimated joint probability table of HH, to learn Λ\Lambda, we use the Fast Greedy Equivalence Search algorithm with the Discrete BIC score. We use the PyCausal library . We used the default parameters (no hyperparameter tuning) and in particular, we did not assume faithfulness.

Approximate Runtime

The average runtimes for each experiment are in the following table.

Average number of edges

For our experiments, the average total number of edges in Λ,Γ\Lambda,\Gamma (also known as NNZ of GG) are in the following table.

Scatter plots

The scatter plots for the Structural Hamming distance (SHD) versus the total number of edges ∣E(G)∣|E(G)| in GG and that of the unoriented correct edges (UCE) vs ∣E(G)∣|E(G)| is given in Fig. 7.