This is an example of how to use simple linear or polynomial regression in Java.
- apache.commons.math3
- Download the official Apache commons math download page
- Include lib file "commons-math3-3.6.1.jar" in the project
The regression modal computes beta[] in such order: y = beta[0] + beta[1]*x(0) + beta[2]*x(1) + beta[3]*x2)