/src/main/java/net/finmath/singleswaprate/annuitymapping/BasicPiterbargAnnuityMapping.java
final double[] volatilitySums = new double[numberOfPeriods];final double[] swapRates = new double[schedule.getNumberOfPeriods( ) ];
final double[] swapRates = new double[schedule.getNumberOfPeriods ( ) ];
final ScheduleFromPeriods partSchedule = new ScheduleFromPeriods(schedule.getReferenceDate(), schedule.getDaycountconvention(), periods); annuities[annuityIndex] = SwapAnnuity.getSwapAnnuity(schedule.getFixing(0), partSchedule, model.getDiscountCurve(discountCurveName), model); } return annuities; } private double[] getForwardSwapRates(final Schedule schedule, final String discountCurveName, final AnalyticModel model){ <extra_id_0> final double discount = model.getDiscountCurve(discountCurveName).getDiscountFactor(model, schedule.getFixing(0)); for(int swapRateIndex=0; swapRateIndex < schedule.getNumberOfPeriods();swapRateIndex++){ swapRates[swapRateIndex] = 1 - model.getDiscountCurve(discountCurveName).getDiscountFactor(model, schedule.getPayment(swapRateIndex)) / discount; swapRates[swapRateIndex] /= initialAnnuities[swapRateIndex]; } return swapRates;