There are many MATLAB functions that do some kind of statistical model fitting, such as fitglm()
. These model fits can fail to converge for various reasons; this question is NOT about what can cause such failures or about how to prevent them.
My question is: is there a way, other than by looking at the console output, to determine if a given call to fitglm()
converged? The obvious way to do this would seem to be through some property of the output arguments, but the list of properties of the Linear Model class doesn't seem to contain this basic information.
A minimal example (inspired by this question):
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]';
m = fitglm(x,y,'distr','binomial');
Warning: Iteration limit reached.
What, if anything, about the output m
tells us that the iteration limit was reached?