MultiGroupDirectLiNGAM¶

class
lingam.
MultiGroupDirectLiNGAM
(random_state=None, prior_knowledge=None, apply_prior_knowledge_softly=False)[source]¶ Implementation of DirectLiNGAM Algorithm with multiple groups [1]
References
[1] (1, 2)  Shimizu. Joint estimation of linear nonGaussian acyclic models. Neurocomputing, 81: 104107, 2012.

__init__
(random_state=None, prior_knowledge=None, apply_prior_knowledge_softly=False)[source]¶ Construct a model.
Parameters:  random_state (int, optional (default=None)) –
random_state
is the seed used by the random number generator.  prior_knowledge (arraylike, shape (n_features, n_features), optional (default=None)) –
Prior knowledge used for causal discovery, where
n_features
is the number of features.The elements of prior knowledge matrix are defined as follows [1]:
0
: \(x_i\) does not have a directed path to \(x_j\)1
: \(x_i\) has a directed path to \(x_j\)1
: No prior knowledge is available to know if either of the two cases above (0 or 1) is true.
 apply_prior_knowledge_softly (boolean, optional (default=False)) – If True, apply prior knowledge softly.
 random_state (int, optional (default=None)) –

adjacency_matrices_
¶ Estimated adjacency matrices.
Returns: adjacency_matrices_ – The list of adjacency matrix B for multiple datasets. The shape of B is (n_features, n_features), where n_features is the number of features. Return type: arraylike, shape (B, ..)

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: arraylike, shape (n_features, n_features)

bootstrap
(X_list, n_sampling)[source]¶ Evaluate the statistical reliability of DAG based on the bootstrapping.
Parameters:  X_list (arraylike, shape (X, ..)) – Multiple datasets for training, where
X
is an dataset. The shape of ‘’X’’ is (n_samples, n_features), wheren_samples
is the number of samples andn_features
is the number of features.  n_sampling (int) – Number of bootstrapping samples.
Returns: results – Returns the results of bootstrapping for multiple datasets.
Return type: arraylike, shape (BootstrapResult, ..)
 X_list (arraylike, shape (X, ..)) – Multiple datasets for training, where

causal_order_
¶ Estimated causal ordering.
Returns: causal_order_ – The causal order of fitted model, where n_features is the number of features. Return type: arraylike, shape (n_features)

estimate_total_effect
(X_list, from_index, to_index)[source]¶ Estimate total effect using causal model.
Parameters:  X_list (arraylike, shape (X, ..)) – Multiple datasets for training, where
X
is an dataset. The shape of ‘’X’’ is (n_samples, n_features), wheren_samples
is the number of samples andn_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
 X_list (arraylike, shape (X, ..)) – Multiple datasets for training, where

fit
(X_list)[source]¶ Fit the model to multiple datasets.
Parameters: X_list (list, shape [X, ..]) – Multiple datasets for training, where X
is an dataset. The shape of ‘’X’’ is (n_samples, n_features), wheren_samples
is the number of samples andn_features
is the number of features.Returns: self – Returns the instance itself. Return type: object

get_error_independence_p_values
(X_list)[source]¶ Calculate the pvalue matrix of independence between error variables.
Parameters: X_list (arraylike, shape (X, ..)) – Multiple datasets for training, where X
is an dataset. The shape of ‘’X’’ is (n_samples, n_features), wheren_samples
is the number of samples andn_features
is the number of features.Returns: independence_p_values – pvalue matrix of independence between error variables. Return type: arraylike, shape (n_datasets, n_features, n_features)