We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 9 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
下面是执行此操作的 C# 代码的链接: http://www.trentfguidry.net/post/2009/08/01/Linear-Regression-of-Polynomial-Coefficients.aspx
祝你好运!
编辑:显然上面的链接已损坏。 我不久前做了另一个解决方案: http:// /procbits.com/2011/05/02/线性回归-in-c-sharp-least-squares/
Here is a link for C# code on to do exactly this: http://www.trentfguidry.net/post/2009/08/01/Linear-Regression-of-Polynomial-Coefficients.aspx
Good luck!
Edit: Apparently the above link is broken. I made another solution awhile back: http://procbits.com/2011/05/02/linear-regression-in-c-sharp-least-squares/
在一般情况下,您需要一个“优化器”或“最小化器”。 请参阅http://en.wikipedia.org/wiki/Optimization_(mathematics)#Solvers 一些示例。 我看到第一个链接 (http://en.wikipedia.org/wiki/IMSL_Numerical_Libraries )声称有 C# 支持。
编辑:对于您建议的有限用途(线性或二次多项式),您可以转到数值食谱的任何副本,获取直接实现,然后翻译成您的语言。 一般的最小化器是矫枉过正的。
但还要注意,多项式可能是较差的预测变量。
In the general case you want an "optimizer" or "mimimizer". See http://en.wikipedia.org/wiki/Optimization_(mathematics)#Solvers for some exmples. I see that the first link (http://en.wikipedia.org/wiki/IMSL_Numerical_Libraries) claims to have c# support.
Edit: For the limited use that you propose (linear or quadratic polynomials), you could just go to any copy of Numerical Recipies, grab a straight ahead implementation, and translate to your language. A general minimizer is overkill.
But note, also, that polynomials may be poor predictors.
您可以检查 GPL 许可证 2.0 下的 ALGLIB 库。 他们有 C#、C++ 的源代码...
http://www.alglib.net/interpolation /leastsquares.php
You can check library form ALGLIB under GPL licence 2.0. They have source code for C#, C++,...
http://www.alglib.net/interpolation/leastsquares.php
您可能需要查看 alglib。 它是用 C++ 而不是 C# 编写的,但您也许可以在它上面编写一个包装器。
You may want to check out alglib. It is in C++ instead of C#, but you might be able to write a wrapper over it.