Skip to content

observationally_equivalent

Signature/Parameters

def observationally_equivalent(self, G)

Test whether two DAGs are observationally equivalent. See details.

Parameters:

Name Type Description Default
G DAG

Graph to compare with the current instance.

required

Returns:

Type Description
bool

True if both graphs encode the same observational constraints, i.e., they belong to the same Markov equivalence class; False otherwise.

Details

The method checks if two DAGs are observationally equivalent by comparing their Markov equivalent classes. The method considers only the DAG structure, that is, CBN or SCM when no functional form for the latter is selected. Observational equivalence is related to Markov equivalence.

Two DAGs are Markov equivalent if and only if

  • They have the same skeleton (same set of adjacencies, i.e., same undirected edges)
  • They have the same set of v-structures (triples where X and Y are not adjacent).

An equivalence class of a DAG is a graph that replaces directional edges with undirected edges except in v-structures. Therefore, all Markov equivalent DAGs will have the same equivalence class.

For CBN:

  • Two CBNs are observationally equivalent if and only if they are Markov equivalent.

For SCM:

SCM without functional form assumptions, for observational equivalence to hold:

  • Necessary condition: both SCMs have the same set of conditional independencies.

  • Sufficient condition: both SCMs are in the same Markov equivalence class (Pearl, 2009).

Basically, two SCMs without imposing any functional form assumptions to either are observationally equivalent if and only if their causal graphs belong to the same Markov equivalence class — i.e., they share the same skeleton and v-structures.

SCM with functional form assumptions:

  • Once you impose functional form restrictions on SCMs, such as linearity, Gaussian disturbance, or additive error, observational equivalence can be strictly finer. That is, Markov equivalence is not a sufficient condition.

Examples:

  • Linear Gaussian SEMs assumption: All DAGs in the same equivalence class remain indistinguishable. Markov equivalence implies observational equivalence and vice-versa. Reason: any covariance matrix that one DAG can generate can also be generated by another DAG in its equivalence class, via suitable parameter choice.

  • Linear non-Gaussian models (LiNGAM): Orientations become testable because independent non-Gaussian noise ‘pins down’ which variable must be the parent, breaking Markov equivalence. Example: \(X \rightarrow Y\) and \(X \leftarrow Y\): In the Gaussian case: indistinguishable. In non-Gaussian: distinguishable.

  • Additive Noise Models (ANMs): - If the true relation is with independent noise , then typically the ‘wrong’ orientation cannot hold with independent noise. So direction becomes identifiable.

In summary, generally, for SCMs with no distributional restrictions, Markov equivalence imply observational equivalence. But once you impose restrictions via functional forms or noise properties to the SCMs (linear, Gaussian, additive, etc.), observational equivalence can be strictly finer than Markov equivalence, and one may be able to distinguish empirically two DAGs inside the same Markov equivalence class. Some Markov-equivalent DAGs become distinguishable. Therefore, as the observational equivalence between Markov equivalent DAGs depends on the functional form assumption adopted, the evaluation is case-by-case.

Examples:

>>> G1 = DAG(graph="X -> Y")
>>> G2 = DAG(graph="X <- Y")
>>> G1.observationally_equivalent(G2)
True
References
  • Pearl, J. (2009). Causality: Models, Reasoning and Inference. Cambridge University Press.
Source code in causalinf/gcm.py
def observationally_equivalent(self, G):
    """
    Test whether two DAGs are observationally equivalent. See details.


    Parameters
    ----------
    G : DAG
        Graph to compare with the current instance.

    Returns
    -------
    bool
        ``True`` if both graphs encode the same observational constraints,
        i.e., they belong to the same Markov equivalence class; ``False``
        otherwise.

    Details
    -------
    The method checks if two DAGs are observationally equivalent by comparing their Markov equivalent classes.
    The method considers only the DAG structure, that is, CBN or SCM when no functional
    form for the latter is selected. Observational equivalence is related to Markov equivalence.

    Two DAGs are Markov equivalent if and only if

    * They have the same skeleton (same set of adjacencies, i.e., same undirected edges)  
    * They have the same set of v-structures (triples $ X -> Z <- Y $ where X and Y are not adjacent).

    An equivalence class of a DAG is a graph that replaces directional edges with undirected edges except
    in v-structures. Therefore, all Markov equivalent DAGs will have the same equivalence class.

    **For CBN:**

    - Two CBNs are observationally equivalent if and only if they are Markov equivalent.

    **For SCM:**

    *SCM without functional form assumptions*, for observational equivalence to hold:

    - Necessary condition: both SCMs have the same set of conditional independencies.

    - Sufficient condition: both SCMs are in the same Markov equivalence class (Pearl, 2009).

    Basically, two SCMs without imposing any functional form assumptions to either
    are observationally equivalent if and only if their causal graphs belong to the same Markov
    equivalence class --- i.e., they share the same skeleton and v-structures.

    *SCM with functional form assumptions:*

    - Once you impose functional form restrictions on SCMs, such as linearity, Gaussian disturbance, or
    additive error, observational equivalence can be strictly finer.
    That is, Markov equivalence is not a sufficient condition.

    **Examples:**

    * *Linear Gaussian SEMs assumption:* All DAGs in the same equivalence class remain indistinguishable.
    Markov equivalence implies observational equivalence and vice-versa. Reason: any covariance matrix that
    one DAG can generate can also be generated by another DAG in its equivalence class, via suitable
    parameter choice.

    * *Linear non-Gaussian models (LiNGAM):*  Orientations become testable because independent
    non-Gaussian noise 'pins down' which variable must be the parent, breaking Markov equivalence.
    Example:  $X \\rightarrow Y$  and  $X \\leftarrow Y$: In the Gaussian case: indistinguishable.
    In non-Gaussian: distinguishable.

    * *Additive Noise Models (ANMs):* - If the true relation is $ Y = f(X) + e $ with independent
    noise $ e $, then typically the 'wrong' orientation $ X = g(Y) + e' $ cannot hold with
    independent noise. So direction becomes identifiable.

    In summary, generally, for *SCMs with no distributional restrictions*, Markov equivalence
    imply observational equivalence. But once you impose restrictions via functional forms
    or noise properties to the SCMs (linear, Gaussian, additive, etc.),
    observational equivalence can be strictly finer than Markov equivalence, and 
    one may be able to distinguish empirically two DAGs inside the same Markov equivalence class.
    Some Markov-equivalent DAGs become distinguishable. Therefore, as the 
    observational equivalence between Markov equivalent DAGs depends on the functional
    form assumption adopted, the evaluation is case-by-case.

    Examples
    --------
    >>> G1 = DAG(graph="X -> Y")
    >>> G2 = DAG(graph="X <- Y")
    >>> G1.observationally_equivalent(G2)
    True

    References
    ----------
    * Pearl, J. (2009). *Causality: Models, Reasoning and Inference*. Cambridge University Press.
    """
    # check if same equivalence class
    G1_eq = self.equivalence_class()
    G2_eq = G.equivalence_class()
    diff = G1_eq.edge_differences(G2_eq)
    obs_eq = True
    for g, edges in diff.items():
        obs_eq &= all([len(e)==0 for e in edges.values()])
    return obs_eq