HighDimDirectLiNGAM
- class lingam.HighDimDirectLiNGAM(J=3, K=4, alpha=0.5, estimate_adj_mat=True, random_state=None)[source]
An implementation of the high-dimensional LiNGAM algorithm. [1]
References
- __init__(J=3, K=4, alpha=0.5, estimate_adj_mat=True, random_state=None)[source]
Construct a HighDimDirectLiNGAM model.
- Parameters:
J (int, optional (default=3)) – Assumed largest in-degree.
K (int, optional (default=4)) – The degree of the moment which is non-Gaussianity.
alpha (float, optional (default=0.5)) – The value for pruning away false parents.
estimate_adj_mat (bool, optional (default=True)) – If Fase, skip the estimation of the adjacency matrix.
random_state (int, optional (default=None)) –
random_state
is the seed used by the random number generator.
- property adjacency_matrix_
Estimated adjacency matrix.
- Returns:
adjacency_matrix_ – The adjacency matrix B of fitted model, where n_features is the number of features.
- Return type:
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 andn_features
is the number of features.n_sampling (int) – Number of bootstrapping samples.
- Returns:
result – Returns the result of bootstrapping.
- Return type:
- property causal_order_
Estimated causal ordering.
- Returns:
causal_order_ – The causal order of fitted model, where n_features is the number of features.
- Return type:
array-like, shape (n_features)
- estimate_total_effect(X, from_index, to_index)
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.
- Returns:
total_effect – Estimated total effect.
- Return type:
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 andn_features
is the number of features.- Returns:
self – Fitted model.
- Return type:
object
- get_error_independence_p_values(X)
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.
- Returns:
independence_p_values – p-value matrix of independence between error variables.
- Return type:
array-like, shape (n_features, n_features)