Equivalent to lsqcurvefit() without the need of the optimisation toolbox
21 次查看(过去 30 天)
显示 更早的评论
Hi
Please let me know additional equivalent functions to lsqcurvefit() with no need to have the optimization toolbox and yield the same outcomes and get the same inputs.
Thanks
0 个评论
采纳的回答
John D'Errico
2019-10-21
编辑:John D'Errico
2019-10-21
If you are hoping to find someone who provides code in MATLAB here to yield the identically exact same results as lsqcurvefit, it won't happen, as that would be a quite complex thing to write for free.
If you are willing to accept methods that are highly limited, then yes, you can find simple nonlinear regression codes on the file exchange, perhaps using fminsearch. But remember that fminsearch is a VERY limited nonlinear optimization tool. And in the end, it will not give you the same results as lsqcurvefit. It will run more slowly. It will not converge as rapidly. It will be highly limited in the number of parameters you can solve for. It will not yield the same outputs that lsqcurvefit does, so if you want something like the Jacobian, too bad.
You may also find tools on the FEX that do a variety of nonlinear regressions using perhaps Gauss-Newton, or even Levenberg-Marquardt. Just remember that free code, written by a novice may not be worth much. So take the time to check out the code, read the reviews carefully, sometimes with a grain of salt, as I have seen people getting their grandmother to write reviews for student written tools on the FEX.
If you have the stats toolbox, then it has a very capable nonlinear regression tool in it. (nlinfit) But it will not be a drop in replacement for lsqcurvefit. (Not too far off though.) If you have the curve fitting toolbox, then it too has capable tools in it, that may be acceptable to you. Of course, they will be even less of a drop in replacement for lsqcurvefit than is nlinfit. Still quite capable, but it will require you to learn to use the tools, and understand how to use them to fit your model.
The optimization toolbox is not that expensive, compared to the amount if time it would take you to replace the call you wish to replace. Your own time is worth something.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Least Squares 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!