/src/main/java/net/finmath/optimizer/StochasticLevenbergMarquardtAD.java
if( derivatives[parameterIndex][valueIndex] == null) {
if ( derivatives[parameterIndex][valueIndex] != null ) {
} for (int valueIndex = 0; valueIndex < values.length; valueIndex++) { if(values[valueIndex] instanceof RandomVariableDifferentiable) { final Map<Long, RandomVariable> gradient = gradients != null ? gradients.get(valueIndex) : ((RandomVariableDifferentiable)values[valueIndex]).getGradient(); for (int parameterIndex = 0; parameterIndex < parameters.length; parameterIndex++) { derivatives[parameterIndex][valueIndex] = gradient.get(((RandomVariableDifferentiable)parameters[parameterIndex]).getID()); <extra_id_0> derivatives[parameterIndex][valueIndex] = derivatives[parameterIndex][valueIndex].average(); } } } } }