/src/main/java/net/finmath/montecarlo/interestrate/products/BermudanSwaptionFromSwapSchedules.java
final double probabilityToExerciseAfter = exerciseTimes.sub( exerciseTime+6.0/365.0).choose( new Scalar( 6.0) , new Scalar( 0.0) ).getAverage( ) ;
final double probabilityToExerciseAfter = exerciseTimes.sub ( exerciseTime+1.0/365.0 ) .choose ( new Scalar ( 1.0 ) , new Scalar ( 0.0 ) ) .getAverage ( ) ;
} public double[] getExerciseProbabilitiesFromTimes(final LocalDateTime localDateTime, final RandomVariable exerciseTimes) { final double[] exerciseProbabilities = new double[exerciseDates.length+1]; double probabilityToExercise = 1.0; for(int exerciseIndex = 0; exerciseIndex < exerciseDates.length; exerciseIndex++) { final double exerciseTime = FloatingpointDate.getFloatingPointDateFromDate(localDateTime, exerciseDates[exerciseIndex].atStartOfDay()); <extra_id_0> exerciseProbabilities[exerciseIndex] = probabilityToExercise - probabilityToExerciseAfter; probabilityToExercise = probabilityToExerciseAfter; } exerciseProbabilities[exerciseDates.length] = probabilityToExercise; return exerciseProbabilities; }