/src/main/java/net/finmath/montecarlo/conditionalexpectation/LinearRegression.java
} return new double[] { alpha0, alpha1 };
return new double[] { alpha0, alpha1 }; }
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(); final double alpha0 = (d * x - b * y) / determinant; final double alpha1 = (a * y - c * x) / determinant; <extra_id_0> } final double[][] BTB = new double[basisFunctions.length][basisFunctions.length]; for(int i=0; i<basisFunctions.length; i++) { for(int j=0; j<=i; j++) { final double covariance = basisFunctions[i].mult(basisFunctions[j]).getAverage(); BTB[i][j] = covariance;