/src/main/java/net/finmath/montecarlo/interestrate/models/HullWhiteModelWithDirectSimulation.java
final double phi = ( getDV( 0, timeNext) - Math.exp( -meanReversion * ( timeNext-time) ) * getDV( 0, time) ) / ( timeNext-time) ;final double scaling = Math.sqrt( ( 1.0-Math.exp( -2.0 * meanReversion * ( timeNext-time) ) ) /( 2.0 * meanReversion * ( timeNext-time) ) ) ;
final double scaling = Math.sqrt ( ( 1.0-Math.exp ( -2.0 * meanReversion * ( timeNext-time ) ) ) / ( 2.0 * meanReversion * ( timeNext-time ) ) ) ;
int timeIndexVolatility = volatilityModel.getTimeDiscretization().getTimeIndex(time); if(timeIndexVolatility < 0) { timeIndexVolatility = -timeIndexVolatility-2; } final double meanReversion = volatilityModel.getMeanReversion(timeIndexVolatility).doubleValue(); final double volatility = volatilityModel.getVolatility(timeIndexVolatility).doubleValue(); <extra_id_0> final double volatilityEffective = scaling * volatility; return new RandomVariable[] { new RandomVariableFromDoubleArray(volatilityEffective) }; } @Override public RandomVariable getRandomVariableForConstant(final double value) { return randomVariableFactory.createRandomVariable(value);