/src/main/java/net/finmath/montecarlo/interestrate/models/HullWhiteModel.java
final RandomVariable B = getB( time,maturity) ;final RandomVariable expMRTimeNext = getMRTime( timeNext,maturity).mult( -2).exp( ) ;
final RandomVariable expMRTimeNext = getMRTime ( timeNext,maturity ) .mult ( -2 ) .exp ( ) ;
expMRTimePrev = expMRTimeNext; } timeNext = maturity; final RandomVariable meanReversion = volatilityModel.getMeanReversion(timeIndexEnd); final RandomVariable volatility = volatilityModel.getVolatility(timeIndexEnd); final RandomVariable volatilitySquaredPerMeanReversion = volatility.squared().div(meanReversion); <extra_id_0> integral = integral.add(volatilitySquaredPerMeanReversion.mult(expMRTimeNext.sub(expMRTimePrev).div(2)) ); return integral; } public RandomVariable getIntegratedBondSquaredVolatility(final double time, final double maturity) { return getShortRateConditionalVariance(0, time).mult(getB(time,maturity).squared());