Skip to content

ENH diagnostic/specification Vuong test for non-nested hypothesis #3897

Closed

Description

@josef-pkt

(I don't find a specific issue, nor experimental code in the sandbox. I thought there should be.)

for non-nested hypothesis the Vuong test is actually trivial
ztest_paired(model1.loglikeobs(res1.params), model2.loglikeobs(res2.params), alternative=...)
or
ztest(model1.loglikeobs(res1.params) - model2.loglikeobs(res2.params), alternative=...)

We need loglikeobs to compute the variance of the difference across observations, otherwise it is jut the log-likelihoodratio.

It gets more complicated if the models are overlapping, or parameters are on the boundary of the parameter space.

application to Poisson versus ZeroInflatedPoisson, available in Stata zip and zinb, and in R pscl
(not clean theoretically, because they are nested in general, or unbound parameter space with Logit/Probit, see also #1357)

#1086 https://gist.github.com/jseabold/6617976

Cameron Trivedi count data 2nd edt. p. 198 secteion 5.4.2

Desmarais, B. A., and J. J. Harden. 2013. “Testing for Zero Inflation in Count Models: Bias Correction for the Vuong Test.” Stata Journal 13 (4): 810–35.

Wilson, Paul. 2015. “The Misuse of the Vuong Test for Non-Nested Models to Test for Zero-Inflation.” Economics Letters 127 (February): 51–53. doi:10.1016/j.econlet.2014.12.029.

One problem for zi models is that using Logit or Probit inflation model can have zero inflation only if linpred goes to inf (or -inf, depending on the definition of params). The edge case causes numerical and convergence problems. With clipping, the prob inflation is bound below > 0. So strictly speaking they are not nested, but the estimate in ZIModel will go to whatever lower bound we impose.)
We could have underinflation, but that is not implemented in the current ZI models. However, we will also get hurdle models which allow for more or fewer zeros than the main model, but it guess the model will be nested also in the implementation to the simple main model, Poisson, NegBin, ...

Activity

  1. added this to the 0.10 milestone on Aug 31, 2017
  2. josef-pkt commented on Aug 31, 2017

    @josef-pkt
    MemberAuthor

    Greene has an old working paper available at SSRN but equations don't render correctly (I didn't read it.)

    Greene, William H., Accounting for Excess Zeros and Sample Selection in Poisson and Negative Binomial Regression Models (March 1994). NYU Working Paper No. EC-94-10. Available at SSRN: https://ssrn.com/abstract=1293115

  3. modified the milestones: 0.10, 0.13 on Dec 3, 2020
  4. josef-pkt commented on Dec 3, 2020

    @josef-pkt
    MemberAuthor

    searching for "vuong" in docs and code comes up empty still

  5. modified the milestones: 0.13, 0.14 on Sep 9, 2021
  6. josef-pkt commented on Nov 22, 2022

    @josef-pkt
    MemberAuthor

    my draft version for compare_lr_test_nonnested and example comparing count models is in notebooks/notebook_old/try_vuong.ipynb

    The version in the notebook is just

    import statsmodels.stats.weightstats as smws
    
    def compare_lr_test_nonnested(results, other, alternative='larger'):
        """Vuong (likelihood ratio) test for non-nested models
        
        This assumes that the models are not nested.
        """
        llo1 = results.model.loglikeobs(results.params)
        llo2 = other.model.loglikeobs(other.params)
        return smws.ztest(llo1 - llo2, alternative=alternative)
    
  7. josef-pkt commented on Mar 14, 2023

    @josef-pkt
    MemberAuthor
  8. josef-pkt commented on Nov 7, 2025

    @josef-pkt
    MemberAuthor

    bump

    I did not realize we don't have it yet. I was searching docs and code for vuong.

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