Robust fitting mode 'LAR' gives negative R squared values.

3 views (last 30 days)
I have to use the 'Robust' fitting option to get a good fit. Changing maximum number of iterations etc. doesn't seem to have much effect. However, if I check the quality of the fit (R squared) I get values of for instance R² = -12E49 for some fits. Most of them give decent values. How can I avoid this?
options = fitoptions('Method','NonlinearLeastSquares',..., *'Robust','LAR'* );
fits = fittype(...,'options', options);
[ft, gf] = fit(Tau, Correlation, fits);

Answers (0)

Community Treasure Hunt

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

Start Hunting!