linearmodels.panel.covariance.HomoskedasticCovariance

class HomoskedasticCovariance(y, x, params, entity_ids, time_ids, *, debiased=False, extra_df=0)[source]

Homoskedastic covariance estimation

Parameters:
yndarray

(entity x time) by 1 stacked array of dependent

xndarray

(entity x time) by variables stacked array of exogenous

paramsndarray

variables by 1 array of estimated model parameters

entity_idsndarray

(entity x time) by 1 stacked array of entity ids

time_idsndarray

(entity x time) by 1 stacked array of time ids

debiasedbool

Flag indicating whether to debias the estimator

extra_dfint

Additional degrees of freedom consumed by models beyond the number of columns in x, e.g., fixed effects. Covariance estimators are always adjusted for extra_df irrespective of the setting of debiased

Notes

The estimator of the covariance is

\[s^2\hat{\Sigma}_{xx}^{-1}\]

where

\[\hat{\Sigma}_{xx} = X'X\]

and

\[s^2 = (n-df)^{-1} \hat{\epsilon}'\hat{\epsilon}\]

where df is extra_df and n-df is replace by n-df-k if debiased is True.

Attributes:
cov

Estimated covariance

eps

Model residuals

name

Covariance estimator name

s2

Error variance

Methods

deferred_cov()

Covariance calculation deferred until executed

Properties

ALLOWED_KWARGS

DEFAULT_KERNEL

cov

Estimated covariance

eps

Model residuals

name

Covariance estimator name

s2

Error variance