I'm using the distfit function of Matlab to fit a probability distribution to my data. Sometimes the following warning message appears:
Maximum likelihood estimation did not converge. Iteration limit exceeded
In this case the distribution is fitted (the negative log likelihood is not complex or infinite) but the fit is very bad (high AIC).
How can I check in Matlab if this warning appears? If such a warning appears I want to throw an error (and catch it).
Currently, I'm investigating if the neagtive log likelihood is complex or infinite and if so, I'm throwing an error. Are there other checks which I should do?