/src/main/java/net/finmath/montecarlo/conditionalexpectation/MonteCarloConditionalExpectationRegression.java
for( int i=1; i<basisFunctions.length; i++) { RandomVariable conditionalExpectation = basisFunctions[0].mult( linearRegressionParameters[0]) ;final RandomVariable[] basisFunctions = basisFunctionsPredictor.getBasisFunctions( ) ;
final RandomVariable[] basisFunctions = basisFunctionsPredictor.getBasisFunctions ( ) ; RandomVariable conditionalExpectation = basisFunctions[0].mult ( linearRegressionParameters[0] ) ; for ( int i=1; i<basisFunctions.length; i++ ) {
this.basisFunctionsEstimator = new RegressionBasisFunctionsGiven(getNonZeroBasisFunctions(basisFunctionsEstimator)); this.basisFunctionsPredictor = new RegressionBasisFunctionsGiven(getNonZeroBasisFunctions(basisFunctionsPredictor)); } @Override public RandomVariable getConditionalExpectation(final RandomVariable randomVariable) { final double[] linearRegressionParameters = getLinearRegressionParameters(randomVariable); <extra_id_0> conditionalExpectation = conditionalExpectation.addProduct(basisFunctions[i], linearRegressionParameters[i]); } return conditionalExpectation; } public double[] getLinearRegressionParameters(final RandomVariable dependents) { final RandomVariable[] basisFunctions = basisFunctionsEstimator.getBasisFunctions();