/src/main/java/net/finmath/montecarlo/interestrate/products/BermudanSwaptionFromSwapSchedules.java
final RandomVariable rateShort = model.getForwardRate( regressionBasisfunctionTimes, exerciseTime, exerciseTime[exerciseIndex + 1]) ;
final RandomVariable rateShort = model.getForwardRate ( exerciseTime, exerciseTime, regressionBasisfunctionTimes[exerciseIndex + 1] ) ;
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); basisFunctions.add(swapRate); } <extra_id_0> basisFunctions.add(rateShort); basisFunctions.add(rateShort.pow(2.0)); final RandomVariable discountFactor = model.getNumeraire(exerciseTime).invert(); basisFunctions.add(discountFactor); return basisFunctions.toArray(new RandomVariable[basisFunctions.size()]); }