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

ENH: Check input to binary models #1978

Merged
merged 2 commits into from Sep 20, 2014

Conversation

Projects
None yet
2 participants
@jseabold
Copy link
Member

commented Sep 20, 2014

see #1053

jseabold added a commit that referenced this pull request Sep 20, 2014

Merge pull request #1978 from jseabold/binary-check
ENH: Check input to binary models

@jseabold jseabold merged commit 1c54d66 into statsmodels:master Sep 20, 2014

1 of 2 checks passed

continuous-integration/travis-ci The Travis CI build is in progress
Details
continuous-integration/appveyor AppVeyor build succeeded
Details

@jseabold jseabold deleted the jseabold:binary-check branch Sep 20, 2014

@josef-pkt

This comment has been minimized.

Copy link
Member

commented Sep 20, 2014

@jseabold can you mention, link to the issue in the description of a PR.
I always have huge problems finding a PR when the issue only shows the commit.

def __init__(self, endog, exog, **kwargs):
super(BinaryModel, self).__init__(endog, exog, **kwargs)
if (self.__class__.__name__ != 'MNLogit' and
not np.all(np.unique(self.endog) == [0, 1])):

This comment has been minimized.

Copy link
@josef-pkt

josef-pkt Sep 20, 2014

Member

I don't think that's what we want. It still works for continuous in interval [0,1].
My guess is that the right check is not (endog < 0 & endog > 1).any()

but I haven't gone through the code. S-shaped continuous variables, fractions seem to work well.

This comment has been minimized.

Copy link
@jseabold

jseabold Sep 20, 2014

Author Member

Feel free to submit a new PR. We need to close remaining issues and get a RC out though. I don't recall seeing any theory for non-binary response for logit/probit.

This comment has been minimized.

Copy link
@josef-pkt

josef-pkt Sep 20, 2014

Member

I think it's the same way as Poisson regression not requiring integers.
The few examples that I tried looked fine.
And I'm pretty sure that it's possible to find the theory somewhere. (I didn't go through all details in the Stata manuals yet.)

This comment has been minimized.

Copy link
@jseabold

jseabold Sep 20, 2014

Author Member

I've seen fractional logit but I don't recall seeing that it just goes
through in the MLE.

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.