Can i change iteration limit in robustfit command in matlab

8 visualizzazioni (ultimi 30 giorni)
Hi everyone, Can i change iteration limits in robustfit command in matlab.When i run this command i get the error message "Iteration limit reached".
Thanks

Risposte (1)

John D'Errico
John D'Errico il 7 Mag 2016
Surprisingly, robustfit does not offer the iteration limit as an input.
While you could, in theory, edit the code to change that limit, that is ALWAYS a bad idea. Edits of supplied code are always a bad idea, and often dangerous. My general rule is, if you edit my code, then you own it. Any future problems are yours to resolve. So if you don't understand the code well enough to have written it, then you should never touch it.
From what it looks like, the limit is just a warning anyway. It probably is intended to warn you that you have a particularly nasty set of data, or a poor model for that data. Increasing that limit won't help, just take more time before you get the same warning message.
Finally, you COULD turn off the warning message. Read the help about warning to learn how to disable a specific warning message. (Don't edit the code to do that.) In this case, it should be the message:
'stats:statrobustfit:IterationLimit'
But even then, this is again a bad idea. It is generally a bad idea to disable warning messages. They are put there to tell you that you may have a problem. Hiding your head in the sand does not make a problem go away, nor does closing your eyes.
So, I'd first look at your data. Understand why it is causing a problem, and see if you can get better data some way. Then look at your model. Is it problematic? There are many ways to choose a bad model for some process. Are you overfitting the data?
If all else fails, then accept that robustfit did the best that it could with this set of data and this model. It will return an answer.

Community Treasure Hunt

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

Start Hunting!

Translated by