-
-
Notifications
You must be signed in to change notification settings - Fork 457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error / Usage issue in polynomial regression #42
Comments
Just stumbled over that issue, and did not want to leave it uncommented.
So, in the test above, a linear regression was fitted through the data, giving a regression with slope of 10, offset of -5.333, and R2 of 0.951. Using an instance of org.apache.commons.math3.fitting.PolynomialCurveFitter with a degree of 1 gives the same results for slope and offset. |
For reference: Some |
Was the documentation improved? Looks like the parameter names "degree" and "order" which are different for the two APIs might lead to confusion for users such as me. |
I see no substantive, interim change in the relevant API history. I did not find the API confusing, but this discussion offers some perspective. |
@trashgod thx for the excellent link which also points to https://en.wikipedia.org/wiki/Degree_of_a_polynomial - it seems its often worthwile to have a proper glossary ... |
the following unit tests compares the org.jfree.data.statistics.Regression.getPolynomialRegression
to the apache commons math3 solution. The results of getPolynomialRegression
are
-5,333 10,000 0,951
while the correct result would be:
coeff 0: 4,000
coeff 1: 2,000
coeff 2: 1,000
you might want to add testcases like the ones in http://alvinalexander.com/java/jwarehouse/commons-math3-3.6.1/src/test/java/org/apache/commons/math3/fitting/PolynomialCurveFitterTest.java.shtml
or improve the documentation on how to use the function correctly.
The text was updated successfully, but these errors were encountered: