在java中绘制数据并使用余弦进行最小二乘回归

发布于 2024-09-04 07:01:43 字数 152 浏览 5 评论 0原文

我有想要绘制的数据,更重要的是,使用余弦(而不是使用多项式)进行最小二乘回归:

 http://imgur.com/AkEaE.png

有什么建议吗?谢谢。

I have data I would like to plot, and more importantly, do a least squares regression on using cosines (instead of using polynomials):

http://imgur.com/AkEaE.png

Any recommendations? Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

梨涡少年 2024-09-11 07:01:43

以下页面可能解决了您目标的回归部分:

http: //www.teneighty.org/software/index.html?f=fft&c=e98b8

Probably the following page solves the regression part of your aim:

http://www.teneighty.org/software/index.html?f=fft&c=e98b8

染柒℉ 2024-09-11 07:01:43

您可能会发现这个演示最小二乘法和数据拟合很有帮助,因为它解决了您的一些问题。

You might find this demo Least Squares & Data Fitting helpful since it solves a few of your problems.

人间☆小暴躁 2024-09-11 07:01:43

只是一点警告性建议。如果您认为您的基础函数以余弦级数为基础,那么使用傅立叶级数是有意义的;但是,如果您将其用作任意函数(形状未知)的基础,您可能会更好地尝试猜测更具体的基础函数类型(多项式、指数等)。

我对这样的一个系列做了一些约束优化,并且函数波动太大,很难说我的拟合是否有意义;我的拟合函数有大量的局部最大值。

Just a bit of cautionary advice. Using a Fourier series makes sense if you think your underlying function has a cosine series as a basis; however, if you are using it as a basis for an arbitrary function (with unknown shape), you may do better trying to guess at a more specific underlying function type (polynomial, exponential, etc).

I did some constrained optimization on such a series, and the function wiggled around so much it was hard to say if my fit was meaningfull; my fit function had great number of local maxima.

萌︼了一个春 2024-09-11 07:01:43

MathGL 可以绘图、拟合(借助 GSL)并显示拟合结果 - 请参阅 此示例

MathGL can plot, fit (by help of GSL) and show fitting result - see this sample

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文