LongitudinalLiNGAM¶

class
lingam.
LongitudinalLiNGAM
(n_lags=1, measure='pwling', random_state=None)[source]¶ Implementation of Longitudinal LiNGAM algorithm [1]
References
[1] K. Kadowaki, S. Shimizu, and T. Washio. Estimation of causal structures in longitudinal data using nonGaussianity. In Proc. 23rd IEEE International Workshop on Machine Learning for Signal Processing (MLSP2013), pp. 1–6, Southampton, United Kingdom, 2013. 
__init__
(n_lags=1, measure='pwling', random_state=None)[source]¶ Construct a model.
Parameters:  n_lags (int, optional (default=1)) – Number of lags.
 measure ({'pwling', 'kernel'}, default='pwling') – Measure to evaluate independence : ‘pwling’ or ‘kernel’.
 random_state (int, optional (default=None)) –
random_state
is the seed used by the random number generator.

adjacency_matrices_
¶ Estimated adjacency matrices.
Returns: adjacency_matrices_ – The list of adjacency matrix B(t,t) and B(t,tτ) for longitudinal datasets. The shape of B(t,t) and B(t,tτ) is (n_features, n_features), where n_features
is the number of features. If the previous data required for the calculation are not available, such as B(t,t) or B(t,tτ) at t=0, all elements of the matrix are nan.Return type: arraylike, shape ((B(t,t), B(t,t1), .., B(t,tτ)), ..)

bootstrap
(X_list, n_sampling, start_from_t=1)[source]¶ Evaluate the statistical reliability of DAG based on the bootstrapping.
Parameters:  X_list (arraylike, shape (X, ..)) – Longitudinal 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, ..)) – Longitudinal multiple datasets for training, where

causal_orders_
¶ Estimated causal ordering.
Returns: causal_order_ – The causal order of fitted models for B(t,t). The shape of causal_order is (n_features), where n_features
is the number of features.Return type: arraylike, shape (causal_order, ..)

estimate_total_effect
(X_t, from_t, from_index, to_t, to_index)[source]¶ Estimate total effect using causal model.
Parameters:  X_t (arraylike, shape (n_samples, n_features)) – Original data, where n_samples is the number of samples and n_features is the number of features.
 _t (from) – The timepoint of source variable.
 from_index – Index of source variable to estimate total effect.
 to_t – The timepoint of destination variable.
 to_index – Index of destination variable to estimate total effect.
Returns: total_effect – Estimated total effect.
Return type: float

fit
(X_list)[source]¶ Fit the model to datasets.
Parameters: X_list (list, shape [X, ..]) – Longitudinal multiple datasets for training, where X
is an dataset. The shape ofX
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
()[source]¶ Calculate the pvalue matrix of independence between error variables.
Returns: independence_p_values – pvalue matrix of independence between error variables. Return type: arraylike, shape (n_features, n_features)

residuals_
¶ Residuals of regression.
Returns: residuals_ – Residuals of regression, where E
is an dataset. The shape ofE
is (n_samples, n_features), wheren_samples
is the number of samples andn_features
is the number of features.Return type: list, shape [E, ..]
