how to fix Iteration limit reached warning

67 ビュー (過去 30 日間)
mina
mina 2014 年 9 月 3 日
コメント済み: mina 2014 年 9 月 16 日
Dear All
I am using logistic regression . I have results using glmfit but with a warning message that "iteration limit is reached". I would like to increase this limit. How to do do that when I ask "glmfit" ? beside i have to say that i tried edit glmfit, line 284, and change itration from 100 to 10000 but it dose not work.
Thank you in advance
  2 件のコメント
mina
mina 2014 年 9 月 3 日
thank for your answer but how can i fix this problem?

サインインしてコメントする。

採用された回答

Tom Lane
Tom Lane 2014 年 9 月 12 日
This can be a symptom of perfect separation between the classes, or of something similar to perfect separation. Consider this:
>> x = [7 0;0 0;8 0;9 0;7 1;8 0;7 0;4 0;7 0;2 0];
>> y = [0 0 1 1 1 0 0 1 0 0]';
>> fitglm(x,y,'distr','binomial');
Warning: Iteration limit reached.
>> fitglm(x(:,2),y,'distr','binomial');
Warning: Iteration limit reached.
Warning: The estimated coefficients perfectly separate failures from successes. This means the theoretical best estimates are not
finite. For the fitted linear combination XB of the predictors, the sample proportions P of Y=N in the data satisfy:
XB=-0.693147: P=0.333333
XB>-0.693147: P=1
Here's a case where the iteration limit was met because the true parameter values are drifting off to infinity. In the second case, the function diagnosed the problem and tried to explain it. In the first case, the function was unable to diagnose the problem and just gave up.
I don't know if this is the case in your example. Do you see coefficients getting large so that x*b is big? I'd be willing to try to diagnose the problem if you want to send me your data.
  2 件のコメント
mina
mina 2014 年 9 月 16 日
@Tom Lane

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by