Hello Everyone, Im working with Quantrix. A java based software.
The scripting language is Groovy and i want to build a customized function, a simple linear regression.
Im not a java developer so I truly just know the fundamentals.
My code takes a gander right now like this. I think the issue is some place in the syntax, which im not that familiar working with.
double simple_regression(double dependend_values, double independend_values, double x_test)
{
slope = double slope(dependend_values, independend_values)
intercept = double intercept(dependend_values, independend_values)
return intercept + slope * x_test
}
Here is another try, done in a java online compiler
public class simple_regression {
static void main (String [] args) {
int x=10;
int y=25;
int x_test=20;
double predict;
SimpleRegression sreg = SimpleRegression();
sreg.addData();
sreg.addData(x, y);
predict = sreg.predict(x_test);
System.out.println(predict);
}
}
and this is the error i get
/simple_regression.java:7: error: cannot find symbol
SimpleRegression sreg = SimpleRegression();
^
symbol: class SimpleRegression
location: class simple_regression
/simple_regression.java:7: error: cannot find symbol
SimpleRegression sreg = SimpleRegression();
^
symbol: method SimpleRegression()
location: class simple_regression
2 errors