estimate_b_lasso_from_cov#

causalbase.lingam.estimate_b_lasso_from_cov(causal_order, cov, n_samples=1000, lambda_selection='fixed', prune_thres=0.05, gamma=1.0)[source]#

Estimate the coefficient matrix B by adaptive Lasso.

Parameters:
causal_orderSequence[int]

Variable indices from source to sink.

covnumpy.ndarray

Covariance matrix, shape (p, p).

n_samplesint

Total number of samples. Only "bic" uses it.

lambda_selection{“fixed”, “bic”}

"fixed" sets the penalty to 0.01 times the mean variance of the parents; "bic" picks it from a grid of 20 by BIC.

prune_thresfloat

Coefficients smaller than this in absolute value become zero.

gammafloat

Exponent of the adaptive weights.

Returns:
numpy.ndarray

B[child, parent], shape (p, p).

Raises:
ValueError

If lambda_selection is not "fixed" or "bic".