linearmodels.panel.covariance.HeteroskedasticCovariance¶
-
class linearmodels.panel.covariance.HeteroskedasticCovariance(y: ndarray[Any, dtype[float64]], x: ndarray[Any, dtype[float64]], params: ndarray[Any, dtype[float64]], entity_ids: ndarray[Any, dtype[int64]], time_ids: ndarray[Any, dtype[int64]], *, debiased: bool =
False
, extra_df: int =0
)[source]¶ Covariance estimation using White estimator
- Parameters:¶
- y: ndarray[Any, dtype[float64]]¶
(entity x time) by 1 stacked array of dependent
- x: ndarray[Any, dtype[float64]]¶
(entity x time) by variables stacked array of exogenous
- params: ndarray[Any, dtype[float64]]¶
variables by 1 array of estimated model parameters
- entity_ids: ndarray[Any, dtype[int64]]¶
(entity x time) by 1 stacked array of entity ids
- time_ids: ndarray[Any, dtype[int64]]¶
(entity x time) by 1 stacked array of time ids
- debiased: bool =
False
¶ Flag indicating whether to debias the estimator
- extra_df: int =
0
¶ 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
\[n^{-1}\hat{\Sigma}_{xx}^{-1}\hat{S}\hat{\Sigma}_{xx}^{-1}\]where
\[\hat{\Sigma}_{xx} = n^{-1}X'X\]and
\[\hat{S} = (n-df)^{-1} \sum_{i=1}^n \hat{\epsilon}_i^2 x_i'x_i\]where df is
extra_df
and n-df is replace by n-df-k ifdebiased
isTrue
.Methods
Covariance calculation deferred until executed
Properties
Estimated covariance
Model residuals
Covariance estimator name
Error variance