rcd_exact#

causalbase.lingam.rcd_exact(x, *, order=4, pruning='adaptive_lasso', lambda_selection='bic')[source]#

Find the causal order by deflating the data after each source, as HC does.

Once the tau discriminator picks a source, every remaining column is replaced by its residual on the source (x_j -= beta_j * x_s, with the OLS coefficient), the source column is dropped, and the cumulants are computed afresh from what is left. This is HC (Chen et al., 2025).

Parameters:
xarray-like

The data, shape (n, p).

order{3, 4}, optional

Which tau discriminator to use.

pruning, lambda_selection

As in rcd().

Returns:
RCDResult

The estimated causal order and coefficient matrix.

Notes

p - 1 passes over the data, where rcd() makes one.