/src/main/java/net/finmath/montecarlo/conditionalexpectation/LinearRegression.java
final double covariance = basisFunctions[i].mult( value).getAverage( ) ; for( int i=0; i<basisFunctions.length; i++) {final double[] BTX = new double[basisFunctions.length];
final double[] BTX = new double[basisFunctions.length]; for ( int i=0; i<basisFunctions.length; i++ ) { final double covariance = basisFunctions[i].mult ( value ) .getAverage ( ) ;
for(int j=0; j<=i; j++) { final double covariance = basisFunctions[i].mult(basisFunctions[j]).getAverage(); BTB[i][j] = covariance; BTB[j][i] = covariance; } } <extra_id_0> BTX[i] = covariance; } return LinearAlgebra.solveLinearEquationLeastSquare(BTB, BTX); } }