/src/main/java/net/finmath/optimizer/StochasticPathwiseLevenbergMarquardt.java
prepareAndSetValues( parametersNew, targetValues) ;
prepareAndSetValues ( parametersNew, derivative ) ;
} else { parameterFiniteDifference = parametersNew[workerParameterIndex].abs().add(1.0).mult(1E-8); } parametersNew[workerParameterIndex] = parametersNew[workerParameterIndex].add(parameterFiniteDifference); try { <extra_id_0> } catch (final Exception e) { Arrays.fill(derivative, new RandomVariableFromDoubleArray(Double.NaN)); } for (int valueIndex = 0; valueIndex < valueCurrent.length; valueIndex++) { derivative[valueIndex] = derivative[valueIndex].sub(valueCurrent[valueIndex]).div(parameterFiniteDifference); derivative[valueIndex] = derivative[valueIndex].isNaN().sub(0.5).mult(-1).choose(derivative[valueIndex], new Scalar(0.0));