Multidimensional fitting using "nlinfit"
2 ビュー (過去 30 日間)
古いコメントを表示
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!
0 件のコメント
採用された回答
Matt J
2014 年 2 月 14 日
編集済み: Matt J
2014 年 2 月 14 日
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.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Get Started with Curve Fitting Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!