/src/main/java/net/finmath/montecarlo/interestrate/models/HullWhiteModelWithShiftExtension.java
final double meanReversion = volatilityModel.getMeanReversion ( timeIndex-1 ) .doubleValue ( ) ;
} double integral = 0.0; double timePrev = time; double timeNext; for(int timeIndex=timeIndexStart+1; timeIndex<=timeIndexEnd; timeIndex++) { timeNext = volatilityModel.getTimeDiscretization().getTime(timeIndex); <extra_id_0> final double volatility = volatilityModel.getVolatility(timeIndex-1).doubleValue(); integral += volatility * volatility * (timeNext-timePrev)/(meanReversion*meanReversion); integral -= volatility * volatility * 2 * (Math.exp(- getMRTime(timeNext,maturity))-Math.exp(- getMRTime(timePrev,maturity))) / (meanReversion*meanReversion*meanReversion); integral += volatility * volatility * (Math.exp(- 2 * getMRTime(timeNext,maturity))-Math.exp(- 2 * getMRTime(timePrev,maturity))) / (2 * meanReversion*meanReversion*meanReversion); timePrev = timeNext; }