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