Announcement

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

  • Not concave iterations in melogit command

    Hi guys,

    I'm trying to run melogit , but it seems that computer won't stop iterations. And there is also a message "not concave". My questions are: Is there a solution for it? If I stop iterations and get results, are they valid??

    Many thanx

  • #2
    There are a number of things that can cause this. Without seeing your actual commands and the output you are getting, it isn't possible to say which.

    If you stop the iterations and get results they are not valid.

    However, stopping iterations and looking at the results is a good first step to diagnosing the problem. To do that, restart the model with the -iterate()- option set for a number of iterations that gets you just into the point where the reported log-likelihood stops changing and the "not convcave" message appears. Inspect those results looking for unreasonably large coefficients or standard errors. Variables that exhibit that are often the source of the problem and need to be dealt with in some way. The other thing you might see is a variance component that is extremely small. If the variance at a given level is zero or very close to it, the model generally will not converge. If you find those problems, you need to re-specify your model eliminating the offending variable or variance level.

    Another thing to look at is the scaling of your variables. If the orders of magnitude among your predictor variables differ appreciably, that can cause numerical difficulties. In that case you should rescale some of your variables so that all of the variables have similar orders of magnitude. (For example, change a money variable denominated in dollars to thousands or millions of dollars so that the numbers are more like those of a "year in business" variable, etc.)

    Another possibility is that -melogit- is getting caught up in a local maximum (or, worse, a local minimum). Specifying starting values might be helpful. Running the model as a single-level model with -logit- might lead to reasonable starting values. Another possibility, if your model has more than two levels, is simplifying it to two levels by discarding some, and using results from that estimation as starting values.

    If you don't find any of those things, then a common source of this problem is that your model is not identifiable. Puzzling that one out requires a fair amount of thought and a good understanding of what each component of your model represents. There is no way to give a quick discussion of how to troubleshoot that here. Often in that situation you just have to go back to square one. Start estimating a model with just one predictor and two levels. Then add in more predictors and more levels one step at a time until you find what breaks it.

    I should also point out that there is another command, -meqrlogit- that estimates the exact same model as -melogit-, but uses a different numerical estimation algorithm. It often succeeds where -melogit- fails. However, in my experience, if you are getting the "not concave" message, -meqrlogit- will not help. "Not concave" almost always indicates a problem in the model itself.

    At the end of the day, these are difficult problems to resolve.
    Last edited by Clyde Schechter; 28 Aug 2016, 10:19. Reason: Added another suggestion.

    Comment


    • #3
      Thank you Clyde,
      I will try to implement your suggestions.

      Again many thanx

      Comment


      • #4
        Thanks for the very helpful analysis, Clyde!

        I notice that page 17 of the Mixed Effects manual suggests a maximization option for these problems:

        If your data and model are nearly unidentified, as opposed to fully unidentified, you may be
        able to obtain convergence with standard errors by changing some of the settings of the gradient-based
        optimization. Adding the difficult option can be particularly helpful if you are seeing
        many “nonconcave” messages;
        It seems bizarre that just typing "difficult" in the options would solve the problem. Is this something you recommend? Are there any downsides? (It seems like there must be some kind of trade-off in whatever "difficult" does or the programmers would have just built it into the regular command.)

        Comment


        • #5
          Originally posted by Reshad Rohan View Post
          Hi guys,

          I'm trying to run melogit , but it seems that computer won't stop iterations. And there is also a message "not concave". My questions are: Is there a solution for it? If I stop iterations and get results, are they valid??

          Many thanx
          Just to elaborate a little bit on what Clyde said, when Stata's estimation algorithm converges, that means it has found the maximum likelihood estimate of the parameters, i.e. the values of the parameters that are most likely to explain your data.

          Many likelihood models converge easily, but many hierarchical models can have trouble, as you've seen. If Stata keeps declaring not concave, that means that the maximization algorithm doesn't know where to advance next. If you interrupt the algorithm before it declares victory, or if it flat out refuses to declare victory, then you are not at the maximum likelihood estimate of the parameters, and your results are not valid. Do not present them anywhere, and tell all your friends not to.

          Originally posted by William Peterson View Post
          Thanks for the very helpful analysis, Clyde!

          It seems bizarre that just typing "difficult" in the options would solve the problem. Is this something you recommend? Are there any downsides? (It seems like there must be some kind of trade-off in whatever "difficult" does or the programmers would have just built it into the regular command.)
          The manual itself says the downside: sometimes the difficult algorithm actually works worse than the default, and there's no way to tell when it will work. In my limited experience, if your likelihood function has hit an asymptote but Stata's repeatedly declaring not concave and refusing to converge, the difficult algorithm won't help. This situation has happened to me a bunch of times when a logit intercept is trending towards infinity or negative infinity. Sometimes, as Clyde mentioned, the problem is that you have some variables on a very different scale than others, e.g. you have one variable that is cost and has values in the millions or billions, and everything else is on more like a -1 to +1 scale. I suspect difficult won't help there, but this situation has not happened to me in real life yet.
          Last edited by Weiwen Ng; 06 Dec 2018, 08:03.
          Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

          When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

          Comment

          Working...
          X