Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no bse in robust with norm=TrimmedMean #425

Closed
josef-pkt opened this issue Aug 12, 2012 · 5 comments

Comments

Projects
None yet
3 participants
@josef-pkt
Copy link
Member

commented Aug 12, 2012

I'm trying out different options for RLM.

I don't know what the answer is (non-differentiability ?)

hsalta = RLM(endog, exog, M=robust.norms.TrimmedMean()).fit()

>>> hsalta.bse
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "e:\josef\eclipsegworkspace\statsmodels-git\statsmodels-josef_new\statsmodels\base\wrapper.py", line 35, in __getattribute__
    obj = getattr(results, attr)
  File "e:\josef\eclipsegworkspace\statsmodels-git\statsmodels-josef_new\statsmodels\tools\decorators.py", line 95, in __get__
    _cachedval = self.fget(obj)
  File "e:\josef\eclipsegworkspace\statsmodels-git\statsmodels-josef_new\statsmodels\robust\robust_linear_model.py", line 467, in bse
    return np.sqrt(np.diag(self.bcov_scaled))
  File "e:\josef\eclipsegworkspace\statsmodels-git\statsmodels-josef_new\statsmodels\tools\decorators.py", line 95, in __get__
    _cachedval = self.fget(obj)
  File "e:\josef\eclipsegworkspace\statsmodels-git\statsmodels-josef_new\statsmodels\robust\robust_linear_model.py", line 425, in bcov_scaled
    m = np.mean(model.M.psi_deriv(self.sresid))
  File "e:\josef\eclipsegworkspace\statsmodels-git\statsmodels-josef_new\statsmodels\robust\norms.py", line 77, in psi_deriv
    raise NotImplementedError
NotImplementedError
@josef-pkt

This comment has been minimized.

Copy link
Member Author

commented Aug 13, 2012

typos in norms

method derive instead of deriv
subzet instead of subset

I'm not completely sure it's correct, but looks ok after fixing typos

tests coverage?

@jseabold

This comment has been minimized.

Copy link
Member

commented Aug 13, 2012

Did you push the change or should I? There's no test because trimmed mean wasn't in SAS, but it should be correct. The derivative is simple enough here.

@josef-pkt

This comment has been minimized.

Copy link
Member Author

commented Aug 13, 2012

I have it currently in my branch, working on LTS. To avoid merge conflicts it's easier if I do it. I'm also looking at the adjustments for trimming for the scale estimate in the Doornik paper. scale estimate is too small I guess.

josef-pkt added a commit to josef-pkt/statsmodels that referenced this issue Aug 14, 2012

@kdebrab

This comment has been minimized.

Copy link

commented Aug 5, 2013

Will this typo bugfix be part of 0.5.0? I hope so...

@jseabold

This comment has been minimized.

Copy link
Member

commented Aug 5, 2013

Hmm, it doesn't look like this was ever put into master. I'll apply it so it will be in the release. Thanks for the reminder.

jseabold added a commit that referenced this issue Aug 6, 2013

Merge pull request #1023 from jseabold/maintenance/0.5.x
BUG: robust.norms.TrimmedMean fix typos in psi_deriv closes #425

@josef-pkt josef-pkt closed this in d66364a Aug 14, 2013

jseabold added a commit that referenced this issue Aug 14, 2013

MAINT: Merge branch 'maintenance/0.5.x'. Merge to close issues.
* maintenance/0.5.x:
  BUG: fix warning arguments in GenericLikelihoodModel
  MAINT: Add name to .mailmap.
  ENH: Pandas Series no longer inherits from ndarray. Closes #1036.
  TST: Fixed test for Anaconda on Windows
  TST: Make test compatible with pandas 0.7.x
  BUG: Fail gracefully when not enough obs given for order.
  BUG: Handle non-string names in lag name making.
  TST: Test for issue 1038.
  DOC: fix docstrings so Latex finishes
  REF: add shapes to Transf_gen, small cleanups
  add explicit shapes to TestTransf2: fixes the fail w/scipy PR/2588
  BUG: acorr_breush_godfrey fix nlags choice closes #676
  BUG: return only yfitted if return_sorted is False closes #922
  TST: Add regression test for #1025.
  BUG: Check for 0 variance not unit. Closes #1025.
  BUG: robust.norms.TrimmedMean fix typos in psi_deriv closes #425
  ENH: Bump Python and NumPy versions. Remove 2.5 only code.

PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this issue Sep 2, 2014

PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this issue Sep 2, 2014

Merge pull request statsmodels#1023 from jseabold/maintenance/0.5.x
BUG: robust.norms.TrimmedMean fix typos in psi_deriv closes statsmodels#425

PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this issue Sep 2, 2014

MAINT: Merge branch 'maintenance/0.5.x'. Merge to close issues.
* maintenance/0.5.x:
  BUG: fix warning arguments in GenericLikelihoodModel
  MAINT: Add name to .mailmap.
  ENH: Pandas Series no longer inherits from ndarray. Closes statsmodels#1036.
  TST: Fixed test for Anaconda on Windows
  TST: Make test compatible with pandas 0.7.x
  BUG: Fail gracefully when not enough obs given for order.
  BUG: Handle non-string names in lag name making.
  TST: Test for issue 1038.
  DOC: fix docstrings so Latex finishes
  REF: add shapes to Transf_gen, small cleanups
  add explicit shapes to TestTransf2: fixes the fail w/scipy PR/2588
  BUG: acorr_breush_godfrey fix nlags choice closes statsmodels#676
  BUG: return only yfitted if return_sorted is False closes statsmodels#922
  TST: Add regression test for statsmodels#1025.
  BUG: Check for 0 variance not unit. Closes statsmodels#1025.
  BUG: robust.norms.TrimmedMean fix typos in psi_deriv closes statsmodels#425
  ENH: Bump Python and NumPy versions. Remove 2.5 only code.

yarikoptic added a commit to yarikoptic/statsmodels that referenced this issue Oct 23, 2014

Merge tag 'v0.5.0' into debian
Version 0.5.0

* tag 'v0.5.0':
  DOC: Update release notes with maint branch changes.
  MAINT: Fix mailmap entry.
  BUG: fix warning arguments in GenericLikelihoodModel
  MAINT: Add name to .mailmap.
  ENH: Pandas Series no longer inherits from ndarray. Closes statsmodels#1036.
  TST: Fixed test for Anaconda on Windows
  TST: Make test compatible with pandas 0.7.x
  BUG: Fail gracefully when not enough obs given for order.
  BUG: Handle non-string names in lag name making.
  TST: Test for issue 1038.
  DOC: fix docstrings so Latex finishes
  REF: add shapes to Transf_gen, small cleanups
  add explicit shapes to TestTransf2: fixes the fail w/scipy PR/2588
  BUG: acorr_breush_godfrey fix nlags choice closes statsmodels#676
  BUG: return only yfitted if return_sorted is False closes statsmodels#922
  TST: Add regression test for statsmodels#1025.
  BUG: Check for 0 variance not unit. Closes statsmodels#1025.
  BUG: robust.norms.TrimmedMean fix typos in psi_deriv closes statsmodels#425
  ENH: Bump Python and NumPy versions. Remove 2.5 only code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.