# RESIT¶

class lingam.RESIT(regressor, random_state=None, alpha=0.01)[source]

Implementation of RESIT(regression with subsequent independence test) Algorithm [1]

References

 [1] Jonas Peters, Joris M Mooij, Dominik Janzing, and Bernhard Sch ̈olkopf. Causal discovery with continuous additive noise models. Journal of Machine Learning Research, 15:2009-2053, 2014.

Notes

RESIT algorithm returns an adjacency matrix consisting of zeros or ones, rather than an adjacency matrix consisting of causal coefficients, in order to estimate nonlinear causality.

__init__(regressor, random_state=None, alpha=0.01)[source]

Construct a RESIT model.

Parameters: regressor (regressor object implementing 'fit' and 'predict' function (default=None)) – Regressor to compute residuals. This regressor object must have fit method and predict function like scikit-learn’s model. random_state (int, optional (default=None)) – random_state is the seed used by the random number generator. alpha (float, optional (default=0.01)) – Alpha level for HSIC independence test when removing superfluous edges.
adjacency_matrix_

Returns: adjacency_matrix_ – The adjacency matrix B of fitted model, where n_features is the number of features. array-like, shape (n_features, n_features)
bootstrap(X, n_sampling)

Evaluate the statistical reliability of DAG based on the bootstrapping.

Parameters: X (array-like, shape (n_samples, n_features)) – Training data, where n_samples is the number of samples and n_features is the number of features. n_sampling (int) – Number of bootstrapping samples. result – Returns the result of bootstrapping. BootstrapResult
causal_order_

Estimated causal ordering.

Returns: causal_order_ – The causal order of fitted model, where n_features is the number of features. array-like, shape (n_features)
estimate_total_effect(X, from_index, to_index)[source]

Estimate total effect using causal model.

Parameters: X (array-like, shape (n_samples, n_features)) – Original data, where n_samples is the number of samples and n_features is the number of features. from_index – Index of source variable to estimate total effect. to_index – Index of destination variable to estimate total effect. total_effect – Because RESIT is a nonlinear algorithm, it cannot estimate the total effect and always returns a value of zero float
fit(X)[source]

Fit the model to X.

Parameters: X (array-like, shape (n_samples, n_features)) – Training data, where n_samples is the number of samples and n_features is the number of features. self – Returns the instance itself. object
get_error_independence_p_values(X)[source]

Calculate the p-value matrix of independence between error variables.

Parameters: X (array-like, shape (n_samples, n_features)) – Original data, where n_samples is the number of samples and n_features is the number of features. independence_p_values – RESIT always returns zero array-like, shape (n_features, n_features)