/src/main/java/net/finmath/montecarlo/interestrate/products/components/Option.java
final RandomVariable[] regressionBasisFunctions  = model != null ? regressionBasisFunctionsProvider.getBasisFunctions( evaluationTime, regressionBasisFunctionsProvider) : getBasisFunctions( exerciseDate, model) ;
final RandomVariable[] regressionBasisFunctions  = regressionBasisFunctionsProvider != null ? regressionBasisFunctionsProvider.getBasisFunctions ( evaluationTime, model ) : getBasisFunctions ( exerciseDate, model ) ;
final double exerciseTriggerFloor = exerciseTriggerMean*(1.0-Math.signum(exerciseTriggerMean)*1E-5)-3.0*exerciseTriggerStdDev; final double exerciseTriggerCap = exerciseTriggerMean*(1.0+Math.signum(exerciseTriggerMean)*1E-5)+3.0*exerciseTriggerStdDev; RandomVariable filter = exerciseTrigger.sub(exerciseTriggerFloor).choose(one, zero) .mult(exerciseTrigger.sub(exerciseTriggerCap).mult(-1.0).choose(one, zero)); filter = filter.mult(filterNaN); exerciseTrigger = exerciseTrigger.mult(filter); <extra_id_0> final RandomVariable[] filteredRegressionBasisFunctions = new RandomVariable[regressionBasisFunctions.length]; for(int i=0; i<regressionBasisFunctions.length; i++) { filteredRegressionBasisFunctions[i] = regressionBasisFunctions[i].mult(filter); } final ConditionalExpectationEstimator conditionalExpectationOperator = new MonteCarloConditionalExpectationRegression(filteredRegressionBasisFunctions, regressionBasisFunctions); exerciseTrigger = exerciseTrigger.getConditionalExpectation(conditionalExpectationOperator);