开发者

Approximate a R2 line by a set of points

开发者 https://www.devze.com 2023-01-07 11:26 出处:网络
I\'m working on an application with statistic开发者_如何学C analysis, and I need some help. Given a set of n points, how can I approximate a line by them. I\'m sure there is an algorithm but I couldn\

I'm working on an application with statistic开发者_如何学C analysis, and I need some help. Given a set of n points, how can I approximate a line by them. I'm sure there is an algorithm but I couldn't find it.

Thanks!


The topic is called linear regression, or ordinary least squares. You should be able to find more details in any linear algebra or stat book.

A Java implementation can be found here


If you're trying to fit a straight line, I suggest you look at linear regression. This old SO answer handles the more general case of curve fitting in Java and eventually recommends CurveFitting Java.

0

精彩评论

暂无评论...
验证码 换一张
取 消