/src/main/java/net/finmath/timeseries/models/parametric/GARCH.java
logLikelihood *= 0.5D;
logLikelihood *= 0.5;
final double eval = volScaling * (Math.log((values[i])/(values[i-1]))); h = (omega + alpha * eval * eval) + beta * h; final double evalNext = volScaling * (Math.log((values[i+1])/(values[i]))); logLikelihood += - Math.log(h) - evalNext*evalNext / h; } logLikelihood += - Math.log(2 * Math.PI) * (windowIndexEnd-windowIndexStart); <extra_id_0> return logLikelihood; } public double getLastResidualForParameters(final double omega, final double alpha, final double beta) { final double volScaling = 1.0; double h = omega / (1.0 - alpha - beta); for (int i = windowIndexStart+1; i <= windowIndexEnd; i++) {