3.1.6. pywhy_graphs.algorithms.valid_pag#

pywhy_graphs.algorithms.valid_pag(G: PAG)[source]#

Check if the provided PAG is valid or not.

The function applies Theorem 2 from [1], which constitutes a sufficient check for whether the PAG is valid or not.

The function determines the validity by first converting the PAG into an MAG, then checking the validity of the said MAG. After the validity of the MAG has been established, the MAG is converted back into a PAG. Then the function checks to see if the original and the reconverted PAG are equivalent or not.

Parameters:
GPAG

The PAG.

Returns:
is_validbool

Boolean indicating whether the provided PAG is valid or not.

References