linearmodels.iv.absorbing.AbsorbingLS.fit

AbsorbingLS.fit(*, cov_type='robust', debiased=False, method='auto', absorb_options=None, use_cache=True, lsmr_options=None, **cov_config)[source]

Estimate model parameters

Parameters
cov_typestr

Name of covariance estimator to use. Supported covariance estimators are:

  • “unadjusted”, “homoskedastic” - Classic homoskedastic inference

  • “robust”, “heteroskedastic” - Heteroskedasticity robust inference

  • “kernel” - Heteroskedasticity and autocorrelation robust inference

  • “cluster” - One-way cluster dependent inference. Heteroskedasticity robust

debiasedbool

Flag indicating whether to debiased the covariance estimator using a degree of freedom adjustment.

methodstr

One of:

  • “auto” - (Default). Use HDFE when applicable and fallback to LSMR.

  • “lsmr” - Force LSMR.

  • “hdfe” - Force HDFE. Raises RuntimeError if the model contains continuous variables or continuous-binary interactions to absorb or if the model is weighted.

absorb_optionsdict

Dictionary of options to pass to the absorber. Passed to either scipy.sparse.linalg.lsmr or pyhdfe.create depending on the method used to absorb the absorbed regressors.

use_cachebool

Flag indicating whether the variables, once purged from the absorbed variables and interactions, should be stored in the cache, and retrieved if available. Cache can dramatically speed up re-fitting large models when the set of absorbed variables and interactions are identical.

lsmr_options: dict

Options to ass to scipy.sparse.linalg.lsmr.

Deprecated since version 4.17: Use absorb_options to pass options

**cov_config

Additional parameters to pass to covariance estimator. The list of optional parameters differ according to cov_type. See the documentation of the alternative covariance estimators for the complete list of available commands.

Returns
AbsorbingLSResults

Results container

Notes

Additional covariance parameters depend on specific covariance used. The see the docstring of specific covariance estimator for a list of supported options. Defaults are used if no covariance configuration is provided.

If use_cache is True, then variables are hashed based on their contents using either a 64 bit value (if xxhash is installed) or a 256 bit value. This allows variables to be reused in different models if the set of absorbing variables and interactions is held constant.

Return type

AbsorbingLSResults