I am getting a warning "iteration limit reached" while
using GLMFIT function.
How can I increase this iteration limit? I looked into the
code and figured it has hard coded iteration limit set to
100 iterations. Can I modify the code and increase this
iteration limit? Is there a reason (with statistical
significance) for restricting iteration limit to 100?
> I am getting a warning "iteration limit reached" while
> using GLMFIT function.
>
> How can I increase this iteration limit? I looked into the
> code and figured it has hard coded iteration limit set to
> 100 iterations. Can I modify the code and increase this
> iteration limit? Is there a reason (with statistical
> significance) for restricting iteration limit to 100?
Ketan, there's no statistical reason for restricting the limit to 100. Feel
free to change it in your file. I'll record an enhancement request that
this be made adjustable in a future release.
One cause for excessive iterations can be complete separation in regression
with a binomial response. If the response is true/false, and if there's a
point p such that x<p is all true and x>p is all false, then the maximum
likelihood is infinite. (The same could be true if a linear combination of
multiple x values has such a point.) You could check for that condition.
> One cause for excessive iterations can be complete separation in regression
> with a binomial response.
Just to follow up on what Tom said, 100 iterations is a _lot_ for the IRLS
algorithm that GLMFIT uses. I'm not saying that there aren't cases where you
usefully need more than that, but I suggest first looking that the fit that
you're getting after 100 iterations and seeing if there's anything you should be
paying more atention to in your data. Tom cites the most common example.
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Disclaimer prior to use.