Skip to content

BUG: incorrect CDF in CDFLink - no tests #300

Open

Description

@josef-pkt

see PR #299 missing ppf

a quick browsing of the source shows that there are no tests for probit cauchy or other CDFLink models

Activity

  1. josef-pkt commented on Jun 1, 2012

    @josef-pkt
    MemberAuthor

    discrete Probit has a full set of tests, I think it would be easy just to write the GLM probit tests by comparing to discrete_model Probit

  2. jseabold commented on Jun 1, 2012

    @jseabold
    Member

    According to my notes there is a change in the algorithm necessary for Binomial model with non-canonical links. I'll have to check my references. I haven't looked at this in a while.

  3. josef-pkt commented on Jun 1, 2012

    @josef-pkt
    MemberAuthor

    family.Binomial has it as a permitted link

    links = [L.logit, L.probit, L.cauchy, L.log, L.cloglog]
    

    If it doesn't work correctly yet, then we should add a warning, which links are allowed

  4. jseabold commented on Jun 1, 2012

    @jseabold
    Member

    It's permitted, but I think the logit is the canonical link IIRC. In any event, everything seems to work fine after the PR and I don't have Hardin and Hilbe or McCullagh and Nelder handy.

  5. added a commit that references this issue on Jun 1, 2012
  6. josef-pkt commented on Jun 1, 2012

    @josef-pkt
    MemberAuthor

    after adding ppf: looks good
    ( glm Binomial takes also different data than discrete Probit, which I didn't see yet in the source)

    spector_data = sm.datasets.spector.load()
    spector_data.exog = sm.add_constant(spector_data.exog, prepend=False)
    
    # Probit Model
    probit_mod = sm.Probit(spector_data.endog, spector_data.exog)
    probit_res = probit_mod.fit()
    
    glm_binomp = sm.GLM(spector_data.endog, spector_data.exog, 
                       family=sm.families.Binomial(sm.families.links.probit))
    glm_bp_res = glm_binomp.fit()
    
    
    >>> glm_bp_res.params
    array([ 1.62581031,  0.0517289 ,  1.42633223, -7.45231928])
    >>> probit_res.params
    array([ 1.62581004,  0.05172895,  1.42633234, -7.45231965])
    >>> glm_bp_res.bse
    array([ 0.68973148,  0.08119478,  0.58695852,  2.57155557])
    >>> probit_res.bse
    array([ 0.69388249,  0.08389026,  0.5950379 ,  2.54247232])
    
  7. jseabold commented on Jul 17, 2012

    @jseabold
    Member

    Was this closed by the PR?

  8. josef-pkt commented on Jul 17, 2012

    @josef-pkt
    MemberAuthor

    the bug was fixed, but tests are still missing, so I kept the issue open

  9. added a commit that references this issue on Sep 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions