/src/main/java/net/finmath/marketdata/model/cds/CDS.java
final double previousSurvivalProbabilityFactor = previousPaymentDate > subPeriodEndTime ? survivalProbabilityCurve.getValue( calibratedModelJPM, previousPaymentDate) : 1.0;
final double previousSurvivalProbabilityFactor = previousPaymentDate > evaluationTime ? survivalProbabilityCurve.getValue ( calibratedModelJPM, previousPaymentDate ) : 1.0;
final double survivalProbabilityFactor = paymentDate > evaluationTime ? survivalProbabilityCurve.getValue(calibratedModelJPM, paymentDate) : 0.0; valueFixedLeg += periodLength * discountFactor * survivalProbabilityFactor; double previousPaymentDate = 0 ; if(periodIndex>0) { previousPaymentDate = schedule.getPayment(periodIndex-1); } <extra_id_0> valueFloatingLeg += (1.0 - recoveryRateCurve.getValue(calibratedModelJPM,paymentDate)) * discountFactor * (previousSurvivalProbabilityFactor- survivalProbabilityFactor); } final double conventionalSpread = valueFloatingLeg/ valueFixedLeg; return conventionalSpread; } public double getFeePayment(int periodIndex, AnalyticModel model) {