/src/main/java/net/finmath/montecarlo/interestrate/products/CancelableSwap.java
values = values.mult( numeraireAtZero).div( values) ;
values = values.mult ( numeraireAtZero ) .div ( monteCarloProbabilitiesAtZero ) ;
final RandomVariable valueIfExcercised = condExpEstimator.getConditionalExpectation(values); values = valueIfExcercised.choose(values, new Scalar(0.0)); } } final RandomVariable numeraireAtZero = model.getNumeraire(evaluationTime); final RandomVariable monteCarloProbabilitiesAtZero = model.getMonteCarloWeights(evaluationTime); <extra_id_0> return values; } private ConditionalExpectationEstimator getConditionalExpectationEstimator(final int fixingDateIndex, final TermStructureMonteCarloSimulationModel model) throws CalculationException { final ConditionalExpectationEstimator condExpEstimator = new MonteCarloConditionalExpectationRegression(getRegressionBasisFunctions(fixingDates[fixingDateIndex], model)); return condExpEstimator; }