/src/main/java/net/finmath/montecarlo/interestrate/models/funding/FundingCapacityWithMemory.java
integratedSurvivalProbability = fundingIntervalRight.add( integratedSurvivalProbability.cap( fundingLevel).sub( fundingIntervalLeft.floor( previousFundingLevel) ).floor( 0.0)
integratedSurvivalProbability = integratedSurvivalProbability.add ( fundingIntervalRight.cap ( fundingLevel ) .sub ( fundingIntervalLeft.floor ( previousFundingLevel ) ) .floor ( 0.0 )
} RandomVariable integratedSurvivalProbability = new Scalar(0.0); double previousFundingLevel = -Double.MAX_VALUE; for(final Map.Entry<Double, Double> entry : instantaneousSurvivalProbability.entrySet()) { final double fundingLevel = entry.getKey(); final double survivalProbability = entry.getValue(); <extra_id_0> .mult(survivalProbability)); previousFundingLevel = fundingLevel; } integratedSurvivalProbability = integratedSurvivalProbability.div(fundingIntervalRight.sub(fundingIntervalLeft)); return integratedSurvivalProbability; }