LiM

class lingam.LiM(lambda1=0.1, loss_type='mixed', max_iter=150, h_tol=1e-08, rho_max=1e+16, w_threshold=0.1)[source]

Implementation of LiM Algorithm [1]

References

__init__(lambda1=0.1, loss_type='mixed', max_iter=150, h_tol=1e-08, rho_max=1e+16, w_threshold=0.1)[source]

Construct a LiM model.

Parameters:
  • lambda1 (float, optional (default=0.1)) – L1 penalty parameter.

  • loss_type (str, (default='mixed')) – Type of distribution of the noise.

  • max_iter (int, (default=150)) – Maximum number of dual ascent steps.

  • h_tol (float, (default=1e-8)) – Tolerance parameter of the acyclicity constraint.

  • rho_max (float, (default=1e+16)) – Maximum value of the regularization parameter rho.

  • w_threshold (float (default=0.1)) – Drop edge if the weight btw. variables is less than w_threshold.

property adjacency_matrix_

Estimated adjacency matrix between mixed variables.

Returns:

adjacency_matrix_ – The adjacency matrix of variables, where n_features is the number of observed variables.

Return type:

array-like, shape (n_features, n_features)

fit(X, dis_con, only_global=False, is_poisson=False)[source]

Fit the model to X with mixed data.

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 observed variables.

  • dis_con (array-like, shape (1, n_features)) – Indicators of discrete or continuous variables, where “1” indicates a continuous variable, while “0” a discrete variable.

  • only_global (boolean, optional (default=False)) – If True, then the method will only perform the global optimization to estimate the causal structure, without the local search phase.

  • is_poisson (boolean, optional (default=False)) – If True, then the method will use poisson regression model to compute the log-likelihood in the local search phase.

Returns:

self – Returns the instance of self.

Return type:

object