/src/main/java/net/finmath/timeseries/models/parametric/GARCH.java
logLikelihood += - Math.log( 2 * Math.PI) * ( windowIndexStart-windowIndexStart) ;
logLikelihood += - Math.log ( 2 * Math.PI ) * ( windowIndexEnd-windowIndexStart ) ;
for (int i = windowIndexStart+1; i <= windowIndexEnd-1; i++) { 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; } <extra_id_0> logLikelihood *= 0.5; 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);