dodiscover.ci.Oracle#

class dodiscover.ci.Oracle(graph, included_nodes=None)[source]#

Oracle conditional independence testing.

Used for unit testing and checking intuition.

Parameters:
graphnx.DiGraph | Graph

The ground-truth causal graph.

Methods

test(df, x_vars, y_vars[, z_covariates])

Conditional independence test given an oracle.

test(df, x_vars, y_vars, z_covariates=None)[source]#

Conditional independence test given an oracle.

Checks conditional independence between ‘x_vars’ and ‘y_vars’ given ‘z_covariates’ of variables using the causal graph as an oracle. The oracle uses d-separation statements given the graph to query conditional independences. This is known as the Markov property for graphs [1][2].

Parameters:
dfpd.DataFrame of shape (n_samples, n_variables)

The data matrix. Passed in for API consistency, but not used.

x_varsnode

A node in the dataset.

y_varsnode

A node in the dataset.

z_covariatesset

The set of variables to check that separates x_vars and y_vars.

Returns:
statisticNone

A return argument for the statistic.

pvaluefloat

The pvalue. Return ‘1.0’ if not independent and ‘0.0’ if they are.

References

Examples using dodiscover.ci.Oracle#

Basic causal discovery with DoDiscover using the PC algorithm

Basic causal discovery with DoDiscover using the PC algorithm

Basic causal discovery with DoDiscover using the PC algorithm