How could I modify the maximum number of iteration in mnrfit?

2 views (last 30 days)
I am using 'mnrfit' function for a multinomial logistic regression model. My data size is 200,000, and the number of explanatory variable is 91. I ran this function but it gave me this warning
Warning: Maximum likelihood estimation did not converge. Iteration limit exceeded. You may need to merge categories to increase observed counts. > In mnrfit>nominalFit at 497 In mnrfit at 197
I tried to increase the maximum value of iteration number. but the file is locked so that I couldn't modify the number of maximum value.
In this case, what is the best thing I can do?? Thank you for any advice in advance!!
  2 Comments
KeopZ
KeopZ on 15 May 2015
It seems at first look inside the function code that it is not given as an option. But it can always be modified. Original goes like this, which is the same for nominal or ordinal:
function [b,XWX,pi] = nominalFit(x,y,m,pi,n,k,p,pstar,parallel)
kron1 = repmat(1:k-1,pstar,1);
kron2 = repmat((1:pstar)',1,k-1);
eta = log(pi);
iter = 0;
iterLim = 100;
tolpos = eps(class(pi))^(3/4);
seps = sqrt(eps);
convcrit = 1e-6;
b = 0;
while iter <= iterLim
Walter Roberson
Walter Roberson on 15 May 2015
Mr M. commented "I am also interested about this question!"

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!