def cov_white_simple(results, use_correction=True):
 (xu, hessian_inv) = _get_sandwich_arrays(results)
 sigma = S_white_simple(xu)
 cov_w = _HCCM2(hessian_inv, sigma)
 if use_correction:
  (nobs, k_params) = xu.shape
  cov_w *= (nobs / float((nobs - k_params)))
 return cov_w

def cov_white_simple ( results , use_correction = True ) : ( xu , hessian_inv ) = _get_sandwich_arrays ( results ) sigma = S_white_simple ( xu ) cov_w = _HCCM2 ( hessian_inv , sigma ) if use_correction : ( nobs , k_params ) = xu . shape cov_w *= ( nobs / float ( ( nobs - k_params ) ) ) return cov_w
heteroscedasticity robust covariance matrix parameters results : result instance result of a regression .