Lua 上的曲线拟合
我正在寻找从表格 XY 数据到高斯函数(又名钟形曲线)的曲线拟合算法。通过谷歌搜索,我可以找到一些 Matlab 的高斯拟合算法,这里有几个:
https: //ccrma.stanford.edu/~jos/sasp/Fitting_Gaussian_Data.html
http://jila.colorado.edu/bec/BEC_for_everyone/matlabfitting.htm
一个似乎使用 Matlab 的“polyfit”函数来完成这项工作。
有人见过现成的 Lua 语言算法(高斯或 Polyfit)吗?如果没有,我将非常感谢您帮助创建/移植此类算法,因为以我有限的 Lua 技能,它可能会花费一天的时间。
I'm looking for algorithms to do curve fitting from tabular XY data to a Gaussian function (a.k.a. bell curve). By googling I can find few gaussian fitting algos for Matlab, here are couple of them:
https://ccrma.stanford.edu/~jos/sasp/Fitting_Gaussian_Data.html
http://jila.colorado.edu/bec/BEC_for_everyone/matlabfitting.htm
One seems to use 'polyfit' function of Matlab for the job.
Anyone seen readily made algo for Lua language (either gaussian or polyfit)? If not, I would greatly appreciate one's help for creating/porting such algorithm as it would probably consume a day with my limited Lua skills.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是我尝试从噪声测量数据中提取高斯拟合。
Here's my attempt to extract gaussian fit out of noisy measurement data.
您可以将方程重新排列为线性形式,然后使用 Paul Bourke 的线性回归中描述的方法(页面下方一点)。
如果您需要的话,我可以为您演示重新排列的过程。
如果您确实需要,我可以提供 Lua 中最佳拟合线算法的实现。
You can rearrange the equation to a linear form, and then use the methods described in Linear Regression by Paul Bourke (a little down the page).
If you need, I can demonstrate the rearranging process for you.
If you really need, I can provide an implementation of the line-of-best-fit algorithm in Lua.