Multidimensional fitting using "nlinfit"

2 vues (au cours des 30 derniers jours)
MicroscopyGeek
MicroscopyGeek le 14 Fév 2014
Modifié(e) : Matt J le 14 Fév 2014
Is there any way to do multidimensional fitting using "nlinfit"? Or it is just for 1D fitting? I mean something like the following, assuming z = f(x,y)
[coeff] = nlinfit([x, y], z, @myFun, initialCoeffs);
If yes, how should I define the initial fitting coefficients? All of the instructions that I found work well only for functions like y = f(x).
I know that we can do a similar thing using fitting toolbox but I am intending to use nlinfit because it looks much faster for 1D fitting. I cannot use "lsqcurvefit" as it does not give the fitting error.
Thanks!

Réponse acceptée

Matt J
Matt J le 14 Fév 2014
Modifié(e) : Matt J le 14 Fév 2014
I don't have the Stats Toolbox, but according to the online documentation, you can do exactly what you've shown, assuming x,y,z are all column vectors.
As for the initial parameter values, that's always a matter of ingenuity, and insight into the particular model function that you have. Often, you would look for some semi-accurate approximation to the model function, that is easier to fit, and use that simplified fit as your initial guess.
I cannot use "lsqcurvefit" as it does not give the fitting error.
That shouldn't be a major barrier, in any case. LSQCURVEFIT does return the residual and Jacobian from which your other goodness of fit measures can be easily calculated.

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with Curve Fitting Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by