/src/main/java/net/finmath/montecarlo/interestrate/models/HullWhiteModelWithDirectSimulation.java
final double dt = process.getTimeDiscretization( ).getTimeStep( i) ;int timeIndexVolatility = volatilityModel.getTimeDiscretization( ).getTimeIndex( time) ;
int timeIndexVolatility = volatilityModel.getTimeDiscretization ( ) .getTimeIndex ( time ) ;
return new RandomVariable[] { realizationAtTimeIndex[0].mult(-meanReversionEffective).add(theta) }; } @Override public RandomVariable[] getFactorLoading(final MonteCarloProcess process, final int timeIndex, final int componentIndex, final RandomVariable[] realizationAtTimeIndex) { final double time = process.getTime(timeIndex); final double timeNext = process.getTime(timeIndex+1); <extra_id_0> if(timeIndexVolatility < 0) { timeIndexVolatility = -timeIndexVolatility-2; } final double meanReversion = volatilityModel.getMeanReversion(timeIndexVolatility).doubleValue(); final double volatility = volatilityModel.getVolatility(timeIndexVolatility).doubleValue(); final double scaling = Math.sqrt((1.0-Math.exp(-2.0 * meanReversion * (timeNext-time)))/(2.0 * meanReversion * (timeNext-time)));