Skip to content

ENH: Betareg rebased - #4238

Closed
josef-pkt wants to merge 26 commits into
statsmodels:mainfrom
josef-pkt:betareg_rebased
Closed

josef-pkt wants to merge 26 commits into
statsmodels:mainfrom
josef-pkt:betareg_rebased

Conversation

@josef-pkt

Copy link
Copy Markdown
Member

this is a rebased version of my branch https://github.com/josef-pkt/statsmodels/tree/betareg_2030_3 of PR #2030

I just did the rebase, I don't know what the status is

The unit tests still have some commented out yield statements without corresponding assert

    def test_methylation_precision(self):
        rslt = self.meth_fit
        #yield check_same, links.logit()(rslt.params[-2:]), expected_methylation_precision['Estimate'], 1e-3, "estimate"

When I use
assert_allclose(links.logit()(rslt.params[-2:]), expected_methylation_precision['Estimate'], 1e-3)
instead of the yield, then I get a large test failure

    def test_methylation_precision(self):
        rslt = self.meth_fit
>       assert_allclose(links.logit()(rslt.params[-2:]), expected_methylation_pr
ecision['Estimate'], 1e-3)
E       AssertionError:
E       Not equal to tolerance rtol=0.001, atol=0
E
E       (mismatch 100.0%)
E        x: array([ 36.043653, -36.043653])
E        y: array([ 8.22829, -0.03471])

So there are still problems with convergence when link_precision=links.identity().
(Which I don't think makes a lot of sense anyway, given the positivity constraint on variance/precision)
or there are problems in the unit test themselves.

@josef-pkt josef-pkt mentioned this pull request Jan 31, 2018
@josef-pkt

Copy link
Copy Markdown
Member Author

This pull request introduces 3 alerts - view on lgtm.com

new alerts:

  • 3 for Potentially uninitialized local variable

Comment posted by lgtm.com

@coveralls

coveralls commented Jan 31, 2018 •

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.002%) to 82.169% when pulling 53a3518 on josef-pkt:betareg_rebased into c99558b on statsmodels:master.

@josef-pkt

Copy link
Copy Markdown
Member Author

still failures, looks like it fails when scipy <= 0.16 and passes with newer scipy. (bfgs changes again?)

Comment thread statsmodels/base/model.py

results_class = getattr(self, 'results_class',
GenericLikelihoodModelResults)
genericmlefit = results_class(self, mlefit)

@josef-pkt josef-pkt Jan 31, 2018 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this now generically implemented already in master?

see #2122
count_model uses result_class (which is missing an "s")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants