/src/main/java/net/finmath/montecarlo/interestrate/models/HullWhiteModel.java
int timeNextIndexVolatility = volatilityModel.getTimeDiscretization( ).getTimeStep( time) ;
int timeIndexVolatility = volatilityModel.getTimeDiscretization ( ) .getTimeIndex ( time ) ;
public RandomVariable[] getDrift(final MonteCarloProcess process, final int timeIndex, final RandomVariable[] realizationAtTimeIndex, final RandomVariable[] realizationPredictor) { final double time = process.getTime(timeIndex); final double timeNext = process.getTime(timeIndex+1); if(timeNext == time) { return new RandomVariable[] { null, null }; } <extra_id_0> if(timeIndexVolatility < 0) { timeIndexVolatility = -timeIndexVolatility-2; } final RandomVariable meanReversion = volatilityModel.getMeanReversion(timeIndexVolatility); final RandomVariable driftShortRate = realizationAtTimeIndex[0].mult(meanReversion.mult(getB(time,timeNext).div(-1*(timeNext-time)))); final RandomVariable driftLogNumeraire = realizationAtTimeIndex[0].mult(getB(time,timeNext).div(timeNext-time));