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!

 Akzeptierte Antwort

Matt J
Matt J am 14 Feb. 2014
Bearbeitet: Matt J am 14 Feb. 2014

0 Stimmen

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.

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 14 Feb. 2014

Bearbeitet:

am 14 Feb. 2014

Community Treasure Hunt

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

Start Hunting!

Translated by