divyang4481 / accord

Automatically exported from code.google.com/p/accord
0 stars 0 forks source link

PolynomialRegression.ToString returns the wrong coefficients #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.PolynomialRegression poly = new PolynomialRegression(2);
  var x = new double[] {0,  1,  2,  3,  4,  5,  6,   7,   8,   9,   10};
  var y = new double[] {1,  6,  17, 34, 57, 86, 121, 162, 209, 262, 321};
  poly.Regress(x, y);
  Console.WriteLine("Fit  ={0}", poly.ToString());

What is the expected output? What do you see instead?
Expected: y(x) = 1.00000000000005*x^0 + 1.99999999999998*x^1 + 3*x^2
Actual:   y(x) = 3*x^0 + 1.99999999999998*x^1 + 1.00000000000005*x^2

What version of the product are you using? On what operating system?
2.8.1.0 for .Net 4
Windows 7

Please provide any additional information below.

Note that the coefficients are reverted

Original issue reported on code.google.com by nes...@nsuli.com on 23 May 2013 at 6:06

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r555.

Original comment by cesarso...@gmail.com on 1 Jun 2013 at 10:32