API reference

andrey.MarkovCheckOutput#

class andrey.MarkovCheckOutput(structure, dag, alpha, p_values, uniformity_statistic, uniformity_p_value, metadata=<factory>, _tests=())[source]#

The result of markov_check().

It holds one p-value for each independence the graph implies, and the test of whether those p-values look uniform.

structure is the graph as checked, and dag the DAG whose independences were tested (the graph itself for a DAG, a consistent extension for a CPDAG). p_values and table list the tested independences in order, uniformity_statistic and uniformity_p_value are the Anderson-Darling test of those p-values against the uniform distribution, passed is the check’s verdict, and metadata records the settings used.

property n_tests: int#

The number of independences tested.

property share_dependent: float | None#

The share of the tested independences whose p-value is below alpha.

About alpha when the graph is right and the tests are calibrated; None when nothing was tested.

property passed: bool#

the uniformity p-value is at most alpha.

True also when the graph implies no independence, so nothing was tested.

Type:

False when the p-values are not uniform

property verdict: str#

what was tested and whether the data reject it.

Type:

One sentence

table(*, index=False)[source]#

One row per tested independence: x, y, given, and its p_value.

Nodes are named by label when the graph has labels, and by position with index=True.

Return type:

list[dict[str, Any]]