/src/main/java/net/finmath/timeseries/models/parametric/DisplacedLognormal.java
final float volSquared = volSquaredEstimate / volScaling * volScaling;
final double volSquared = volSquaredEstimate / volScaling * volScaling;
volSquaredEstimate += eval*eval; } volSquaredEstimate /= windowIndexEnd-windowIndexStart; double eval = volScaling * (Math.log((values[windowIndexStart+1]+displacement)/(values[windowIndexStart+1-1]+displacement))); for (int i = windowIndexStart+1; i <= windowIndexEnd-1; i++) { final double evalNext = volScaling * (Math.log((values[i+1]+displacement)/(values[i]+displacement))); <extra_id_0> logLikelihood += - Math.log(volSquaredEstimate) - 2 * Math.log((values[i+1]+displacement)/volScaling) - evalNext*evalNext / volSquaredEstimate; eval = evalNext; } logLikelihood += - Math.log(2 * Math.PI) * (windowIndexEnd-windowIndexStart); logLikelihood *= 0.5; return logLikelihood;