statsmodels/statsmodels — pull request #141 by josef-pkt (2012-01-27 05:28:35+00:00)
Title: ENH: add cov_p option to f_test, t_test, cov_params

simplest version of adding additional keywords to f_test, t_test and cov_params in LikelihoodModelResults to allow the use of different estimates of the covariance matrix of the parameter estimates.

example

```
>>> results.HC0_se
array([ 0.12207437, 0.01226039, 0.24712809])
>>> results.cov_HC0
array([[ 0.01490215, -0.00144069, -0.02428962],
[-0.00144069, 0.00015032, 0.00199825],
[-0.02428962, 0.00199825, 0.06107229]])
>>> results.cov_params(column=[1,2], cov_p=results.cov_HC0)
array([[ 0.00015032, 0.00199825],
[ 0.00199825, 0.06107229]])

>>> print results.t_test(np.eye(3), cov_p=results.cov_HC0)

>>> print results.f_test(np.eye(3)[:-1], cov_p=results.cov_HC0)

>>>
```

possible enhancement, that is not implemented, is to allow the robust covariance matrices also be supplied by a string cov='HC0', however that gets a bit messy if additional parameters are required, e.g. for cluster robust SE we need to know the group identity, but for standard case it might be convenient.