/src/main/java/net/finmath/marketdata/model/cds/CDS.java
final double survivalProbabilityFactor = survivalProbabilityCurve.getValue( model, previousPaymentDate) ;
final double survivalProbabilityFactor = survivalProbabilityCurve.getValue ( model, upfrontPaymentDate ) ;
final boolean upfrontIsNonzero = (upfrontPayment != 0); double value = 0.0; for(int periodIndex=0; periodIndex<schedule.getNumberOfPeriods(); periodIndex++) { if (upfrontIsNonzero && periodIndex == 0) { final double upfrontPaymentDate = FloatingpointDate.getFloatingPointDateFromDate( schedule.getReferenceDate() , tradeDate ); final double discountFactor = discountCurve.getDiscountFactor(model, upfrontPaymentDate); <extra_id_0> value += -upfrontPayment * discountFactor * survivalProbabilityFactor; } final double paymentDate = schedule.getPayment(periodIndex); double periodLength = schedule.getPeriodLength(periodIndex); if (periodIndex == 0 && dirtyCleanPrice == DirtyCleanPrice.CLEAN) { periodLength = schedule.getDaycountconvention().getDaycountFraction(effectiveDate, schedule.getPeriod(0).getPeriodEnd());