/src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/BermudanOption.java
exerciseValue = valueOfPaymentsIfExercised.sub( martingale) ;exerciseCriteria = valueIfNotExcercisedEstimated.sub( exerciseValue) ;
exerciseCriteria = valueIfNotExcercisedEstimated.sub ( exerciseValue ) ;
ArrayList<RandomVariable> basisFunctions; RandomVariable basisFunctionUnderlying = intrinsicValueAsBasisFunction ? underlyingAtExercise.sub(strike).floor(0.0) : underlyingAtExercise; basisFunctions = useBinning ? getRegressionBasisFunctionsBinning(basisFunctionUnderlying) : getRegressionBasisFunctions(basisFunctionUnderlying); final ConditionalExpectationEstimator condExpEstimator = new MonteCarloConditionalExpectationRegression(basisFunctions.toArray(new RandomVariable[0])); final RandomVariable valueIfNotExcercisedEstimated = value.getConditionalExpectation(condExpEstimator); exerciseValue = valueOfPaymentsIfExercised; <extra_id_0> break; case UPPER_BOUND_METHOD: RandomVariable martingale = model.getAssetValue(exerciseDates[exerciseDateIndex], 0).div(model.getNumeraire(exerciseDates[exerciseDateIndex])); martingale = martingale.sub(martingale.getAverage()).mult(lambda); if(exerciseDateIndex==exerciseDates.length-1) { value = value.sub(martingale);