RCD#
- class causalbase.lingam.RCD(method='deflation', order=4, pruning='adaptive_lasso', lambda_selection='bic')[source]#
Learn a linear non-Gaussian causal model from higher-order cumulants.
The third- and fourth-order cumulants of the data feed a tau discriminator that finds the most exogenous variable; what happens to it before the next one is sought depends on method. The coefficients are then estimated on the order from the covariance.
Torrijos, Stella, Gámez & Puerta, “Federated Causal Discovery via Regression-Directed Cumulants”, PGM 2026, of which this is the single-table case. Not to be confused with Repetitive Causal Discovery (Maeda and Shimizu, 2020).
- Parameters:
- method{“deflation”, “exact”, “ratio”, “sort”}, default=”deflation”
What follows each source.
"deflation"removes it from the cumulants with regression coefficients and searches again, so the data are read once."exact"removes it from the data and recomputes the cumulants, one pass per variable, so no estimation error carries from one step to the next."ratio"removes it from the cumulants with cumulant-ratio coefficients, as FedISHC does."sort"sorts once by the tau discriminator.- order{3, 4}, default=4
Order of the cumulants behind the tau discriminator. The fourth-order one needs excess kurtosis, the third-order one skew. HC-LiNGAM is
RCD(method="sort")and HCRCD(method="exact")(Chen et al., IEEE TNNLS 2025).- pruning{“adaptive_lasso”, None}, default=”adaptive_lasso”
How coefficients are estimated on the order.
Noneis ordinary least squares, which keeps every predecessor as a parent.- lambda_selection{“bic”, “fixed”}, default=”bic”
Penalty selection for the adaptive lasso.
- Attributes:
- causal_order_list of str
The variables, most exogenous first.
- coef_ndarray of shape (n_vars, n_vars)
coef_[child, parent]is the coefficient of parent in child’s structural equation.- dag_DAG
The non-zero coefficients as a DAG.
adjacency_pandas.DataFramepandas.DataFrame: The learned DAG as a named adjacency matrix.
- n_features_in_int
- feature_names_in_ndarray of str
Examples
>>> import numpy as np >>> from causalbase.lingam import RCD >>> e = np.random.default_rng(0).laplace(size=(5000, 3)) >>> x = np.column_stack([e[:, 0], 0.8 * e[:, 0] + e[:, 1], e[:, 2]]) >>> x[:, 2] += -0.7 * x[:, 1] >>> RCD().fit(x).causal_order_ ['x0', 'x1', 'x2']
Methods
fit(X[, y])Learn the model from X.
get_params([deep])Return the estimator's hyperparameters by name.
set_params(**params)Set hyperparameters by name and return the estimator.
- fit(X, y=None)[source]#
Learn the model from X.
- Parameters:
- XContinuousDataset, pandas.DataFrame or array-like
Real-valued data of shape (n_rows, n_vars).
- yNone
Ignored.
- Returns:
- self
- Raises:
- ValueError
If X holds too few rows for cumulants of the chosen order, or a hyperparameter is out of range.
- property adjacency_#
pandas.DataFrame: The learned DAG as a named adjacency matrix.
- get_params(deep=True)#
Return the estimator’s hyperparameters by name.
- set_params(**params)#
Set hyperparameters by name and return the estimator.