Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • cannot compute an improvement -- discontinuous region encountered

    Hi, I'm doing ordered logistic regression with panel data set, and ran across with the error message that reads "cannot compute an improvement -- discontinuous region encountered"
    Following the advice on the previous questions in Statlist, I did my regression model with one, two, (and so on) predictors, and figured out what variable is a trouble maker.
    But then, now what? How should I change my model specification?
    The age at the first delivery "age_birth" is one of the important independent variables to explain the independent variable of number of the children.


    Code:
    xtologit children_number age_birth
    
    Fitting comparison model:
    
    Iteration 0:   log likelihood = -8247.2149  
    Iteration 1:   log likelihood = -8123.6735  
    Iteration 2:   log likelihood = -8123.1374  
    Iteration 3:   log likelihood = -8123.1374  
    
    Refining starting values:
    
    Grid node 0:   log likelihood = -5293.4722
    
    Fitting full model:
    
    Iteration 0:   log likelihood = -5293.4722  
    Iteration 1:   log likelihood = -3482.5691  
    Iteration 2:   log likelihood = -3119.9269  
    Iteration 3:   log likelihood = -2363.2178  
    Iteration 4:   log likelihood = -2190.7194  
    Iteration 5:   log likelihood = -2089.1869  
    Iteration 6:   log likelihood = -2041.1365  
    Iteration 7:   log likelihood = -2017.9951  (not concave)
    cannot compute an improvement -- discontinuous region encountered
    r(430);
    Last edited by Daeun Kwan; 19 Jul 2021, 01:28.

  • #2
    There are plenty of things that you can do before giving up. One thing that worked wonders for me back then when fitting such models was to use adaptive quadrature before running Newton-Raphson. This option is available in gllamm from SSC, which can also fit a panel ordered logit model.

    Code:
    ssc install gllamm, replace
    Code:
    webuse tvsfpors
    xtset school
    xtologit thk prethk cc##tv
    
    *WITH GLLAMM
    gen cctv= c.cc#c.tv
    gllamm thk prethk cc tv cctv, i(school) link(ologit) adapt
    Res.:

    Code:
    . xtologit thk prethk cc##tv
    
    Fitting comparison model:
    
    Iteration 0:   log likelihood =  -2212.775  
    Iteration 1:   log likelihood =  -2125.509  
    Iteration 2:   log likelihood = -2125.1034  
    Iteration 3:   log likelihood = -2125.1032  
    
    Refining starting values:
    
    Grid node 0:   log likelihood = -2136.2426
    
    Fitting full model:
    
    Iteration 0:   log likelihood = -2136.2426  (not concave)
    Iteration 1:   log likelihood = -2120.2577  
    Iteration 2:   log likelihood = -2119.7574  
    Iteration 3:   log likelihood = -2119.7428  
    Iteration 4:   log likelihood = -2119.7428  
    
    Random-effects ordered logistic regression      Number of obs     =      1,600
    Group variable: school                          Number of groups  =         28
    
    Random effects u_i ~ Gaussian                   Obs per group:
                                                                  min =         18
                                                                  avg =       57.1
                                                                  max =        137
    
    Integration method: mvaghermite                 Integration pts.  =         12
    
                                                    Wald chi2(4)      =     128.06
    Log likelihood  = -2119.7428                    Prob > chi2       =     0.0000
    
    ------------------------------------------------------------------------------
             thk |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
          prethk |   .4032892     .03886    10.38   0.000      .327125    .4794534
            1.cc |   .9237904    .204074     4.53   0.000     .5238127    1.323768
            1.tv |   .2749937   .1977424     1.39   0.164    -.1125744    .6625618
                 |
           cc#tv |
            1 1  |  -.4659256   .2845963    -1.64   0.102    -1.023724    .0918728
    -------------+----------------------------------------------------------------
           /cut1 |  -.0884493   .1641062                     -.4100916     .233193
           /cut2 |   1.153364    .165616                      .8287625    1.477965
           /cut3 |    2.33195   .1734199                      1.992053    2.671846
    -------------+----------------------------------------------------------------
       /sigma2_u |   .0735112   .0383106                      .0264695    .2041551
    ------------------------------------------------------------------------------
    LR test vs. ologit model: chibar2(01) = 10.72         Prob >= chibar2 = 0.0005
    
    .
    .
    .
    . *WITH GLLAMM
    
    .
    . gen cctv= c.cc#c.tv
    
    .
    . gllamm thk prethk cc tv cctv, i(school) link(ologit) adapt
    
    Running adaptive quadrature
    Iteration 0:    log likelihood = -2123.8577
    Iteration 1:    log likelihood = -2120.0494
    Iteration 2:    log likelihood = -2119.7702
    Iteration 3:    log likelihood = -2119.7605
    Iteration 4:    log likelihood = -2119.7506
    Iteration 5:    log likelihood = -2119.7444
    Iteration 6:    log likelihood = -2119.7442
    
    
    Adaptive quadrature has converged, running Newton-Raphson
    Iteration 0:   log likelihood = -2119.7442  
    Iteration 1:   log likelihood = -2119.7442  (backed up)
    Iteration 2:   log likelihood = -2119.7428  
    Iteration 3:   log likelihood = -2119.7428  
     
    number of level 1 units = 1600
    number of level 2 units = 28
     
    Condition Number = 16.579687
     
    gllamm model
     
    log likelihood = -2119.7428
     
    ------------------------------------------------------------------------------
             thk |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    thk          |
          prethk |   .4032892     .03886    10.38   0.000      .327125    .4794533
              cc |   .9237908   .2040746     4.53   0.000     .5238119     1.32377
              tv |   .2749939   .1977431     1.39   0.164    -.1125754    .6625633
            cctv |  -.4659264   .2845972    -1.64   0.102    -1.023727    .0918739
    -------------+----------------------------------------------------------------
    _cut11       |
           _cons |  -.0884495   .1641067    -0.54   0.590    -.4100927    .2331937
    -------------+----------------------------------------------------------------
    _cut12       |
           _cons |   1.153364   .1656165     6.96   0.000     .8287615    1.477966
    -------------+----------------------------------------------------------------
    _cut13       |
           _cons |    2.33195   .1734203    13.45   0.000     1.992052    2.671847
    ------------------------------------------------------------------------------
     
     
    Variances and covariances of random effects
    ------------------------------------------------------------------------------
    
     
    ***level 2 (school)
     
        var(1): .07351208 (.03831112)
    ------------------------------------------------------------------------------

    You can also fit the same model with a subset of observations (say three-quarters) and if successful, use these estimates as starting values for the estimation with the full sample. There are plenty of examples in the forum showing how you can specify starting values in a maximum likelihood estimation.
    Last edited by Andrew Musau; 19 Jul 2021, 07:53.

    Comment


    • #3
      Wow, it really works wonders for me! Thank you so much!

      Comment

      Working...
      X