Multidimensional fitting using "nlinfit"

2 visualizaciones (últimos 30 días)
MicroscopyGeek
MicroscopyGeek el 14 de Feb. de 2014
Editada: Matt J el 14 de Feb. de 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!

Respuesta aceptada

Matt J
Matt J el 14 de Feb. de 2014
Editada: Matt J el 14 de Feb. de 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.

Más respuestas (0)

Categorías

Más información sobre Get Started with Curve Fitting Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by