/src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/BermudanOption.java
final RandomVariable valueIfNotExcercisedEstimated = value.getRealizations( ) ;
final RandomVariable valueIfNotExcercisedEstimated = value.getConditionalExpectation ( condExpEstimator ) ;
switch(exerciseMethod) { case ESTIMATE_COND_EXPECTATION: 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])); <extra_id_0> exerciseValue = valueOfPaymentsIfExercised; exerciseCriteria = valueIfNotExcercisedEstimated.sub(exerciseValue); break; case UPPER_BOUND_METHOD: RandomVariable martingale = model.getAssetValue(exerciseDates[exerciseDateIndex], 0).div(model.getNumeraire(exerciseDates[exerciseDateIndex])); martingale = martingale.sub(martingale.getAverage()).mult(lambda);