/src/main/java/net/finmath/montecarlo/conditionalexpectation/LinearRegression.java
final double alpha0 = ( d * determinant - b * y) / determinant;
final double alpha0 = ( d * x - b * y ) / determinant;
final double c = b; final double d = basisFunctions[1].squared().getAverage(); final double determinant = (a * d - b * c); if(determinant != 0) { final double x = value.mult(basisFunctions[0]).getAverage(); final double y = value.mult(basisFunctions[1]).getAverage(); <extra_id_0> final double alpha1 = (a * y - c * x) / determinant; return new double[] { alpha0, alpha1 }; } } final double[][] BTB = new double[basisFunctions.length][basisFunctions.length]; for(int i=0; i<basisFunctions.length; i++) {