开发者

Multidimensional polynomial regression (preferably C/C++, Java or Scala)

Given a collection of (N+1)-dimensional real valued vectors with N independent and 1 dependent value, I would like to compute a polynomial of degree 1 (linear), 2 (quadratic) or higher that provides a reasonably good fit (e.g. as determined by least squares error). In other words, when applied to the elements of the collection, the polynomial should map the independent values of each one to the associated dependent value (with some reasonable margin of error).

I expect the dimensionality of the independent variables to be in the range 2..8, and to work on 开发者_Python百科collections of 20..200 elements. I am hoping to fit a polynomial in milliseconds rather than seconds. :-)

I quickly found algorithms for polynomial regression for one-dimensional data, but I have not been able to come up with anything practical for multi-dimensional data. I am interested primarily in algorithm descriptions or source code. Any pointers?


You might want to explore the Weka data mining and machine learning platform - it's extremely comprehensive and includes all kinds of different regression algorithms.

A big bonus is that it is all open source so you can also study the code if you like.


I was looking for the same code and I have found two good examples of this.

See net.sourceforge.openforecast

Specifically see the class PolynomialRegressionModel as a starting point

and a simple single class implementation which is designed for much larger data sets than you mentioned

http://blog.locut.us/2009/11/14/polynomial-regression-on-a-large-dataset-in-java/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜