RCDResult#

class fedcausal.lingam.RCDResult(causal_order, coef)[source]#

A causal order and the coefficient matrix estimated for it.

Attributes:
causal_ordertuple of int

Variable indices, source first. A topological order of the estimated structure.

coefnumpy.ndarray

Shape (p, p). coef[child, parent] is the linear coefficient of parent in child’s structural equation, and is zero whenever parent does not precede child in causal_order. RCD.coef_ is this matrix.

to_dag(threshold=0.0)[source]#

Return the DAG of coefficients whose magnitude exceeds threshold.

Parameters:
thresholdfloat, optional

Keep an edge only when abs(coef[child, parent]) > threshold. The default keeps every non-zero coefficient.

Returns:
DAG

Acyclic by construction: coef is lower-triangular with respect to causal_order, so every edge runs from an earlier variable to a later one.