/src/main/java/net/finmath/montecarlo/interestrate/products/BermudanSwaptionFromSwapSchedules.java
final RandomVariable annuity = SwaptionFromSwapSchedules.getValueOfLegAnalytic ( exerciseTime, model, fixSchedules[exerciseIndexUnderlying], false, 1.0, 1.0 ) ; final RandomVariable swapRate = floatLeg.div ( annuity ) ;
} final RandomVariable one = new RandomVariableFromDoubleArray(1.0); final RandomVariable basisFunction = one; basisFunctions.add(basisFunction); for(int exerciseIndexUnderlying = exerciseIndex; exerciseIndexUnderlying<exerciseDates.length; exerciseIndexUnderlying++) { final RandomVariable floatLeg = SwaptionFromSwapSchedules.getValueOfLegAnalytic(exerciseTime, model, floatSchedules[exerciseIndexUnderlying], true, 0.0, 1.0); <extra_id_0> basisFunctions.add(swapRate); } final RandomVariable rateShort = model.getForwardRate(exerciseTime, exerciseTime, regressionBasisfunctionTimes[exerciseIndex + 1]); basisFunctions.add(rateShort); basisFunctions.add(rateShort.pow(2.0)); final RandomVariable discountFactor = model.getNumeraire(exerciseTime).invert();