*, cov_type='unadjusted', debiased=True, **cov_config)[source]

Estimate model parameters

cov_typestr, optional

Name of covariance estimator. See Notes.

debiasedbool, optional

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


Additional covariance-specific options. See Notes.


Estimation results


Three covariance estimators are supported:

  • ‘unadjusted’, ‘homoskedastic’ - Assume residual are homoskedastic

  • ‘robust’, ‘heteroskedastic’ - Control for heteroskedasticity using White’s estimator

  • ‘clustered` - One or two way clustering. Configuration options are:

    • clusters - Input containing containing 1 or 2 variables. Clusters should be integer values, although other types will be coerced to integer values by treating as categorical variables

    • cluster_entity - Boolean flag indicating to use entity clusters

  • ‘kernel’ - Driscoll-Kraay HAC estimator. Configurations options are:

    • kernel - One of the supported kernels (bartlett, parzen, qs). Default is Bartlett’s kernel, which is produces a covariance estimator similar to the Newey-West covariance estimator.

    • bandwidth - Bandwidth to use when computing the kernel. If not provided, a naive default is used.

When using a clustered covariance estimator, all cluster ids must be identical within a first difference. In most scenarios, this requires ids to be identical within an entity.


>>> from linearmodels import FirstDifferenceOLS
>>> mod = FirstDifferenceOLS(y, x)
>>> robust ='robust')
>>> clustered ='clustered', cluster_entity=True)
Return type