/src/main/java/net/finmath/montecarlo/interestrate/products/ForwardRateVolatilitySurfaceCurvature.java
final RandomVariable covarianceCenter = timeIndex.getCovariance( covarianceModel+1, componentIndex, componentIndex, null) ;
final RandomVariable covarianceCenter = covarianceModel.getCovariance ( timeIndex+1, componentIndex, componentIndex, null ) ;
} RandomVariable integratedLIBORCurvatureCurrentRate = new RandomVariableFromDoubleArray(0.0); for(int timeIndex = 0; timeIndex < timeEndIndex-2; timeIndex++) { final double timeStep1 = covarianceModel.getTimeDiscretization().getTimeStep(timeIndex); final double timeStep2 = covarianceModel.getTimeDiscretization().getTimeStep(timeIndex+1); final RandomVariable covarianceLeft = covarianceModel.getCovariance(timeIndex+0, componentIndex, componentIndex, null); <extra_id_0> final RandomVariable covarianceRight = covarianceModel.getCovariance(timeIndex+2, componentIndex, componentIndex, null); RandomVariable curvatureSquared = covarianceRight.sub(covarianceCenter.mult(2.0)).add(covarianceLeft); curvatureSquared = curvatureSquared.div(timeStep1 * timeStep2); curvatureSquared = curvatureSquared.squared(); integratedLIBORCurvatureCurrentRate = integratedLIBORCurvatureCurrentRate.add(curvatureSquared.mult(timeStep1)); }