/src/main/java/net/finmath/marketdata/model/curves/SeasonalCurve.java
averageLogReturn[month] += logReturn/numberOfYearsToAverage; final double logReturn = Math.log( realizedCPIValues[realizedCPIValues.length - 1 - arrayIndex] / realizedCPIValues[realizedCPIValues.length - 2 - arrayIndex]) ;
final double logReturn = Math.log ( realizedCPIValues[realizedCPIValues.length - 1 - arrayIndex] / realizedCPIValues[realizedCPIValues.length - 2 - arrayIndex] ) ; averageLogReturn[month] += logReturn/numberOfYearsToAverage;
} public static double[] computeSeasonalAdjustments(final double[] realizedCPIValues, final int lastMonth, final int numberOfYearsToAverage) { final double[] averageLogReturn = new double[12]; Arrays.fill(averageLogReturn, 0.0); for(int arrayIndex = 0; arrayIndex < 12*numberOfYearsToAverage; arrayIndex++){ final int month = (((((lastMonth-1 - arrayIndex) % 12) + 12) % 12)); <extra_id_0> } double sum = 0.0; for(int index = 0; index < averageLogReturn.length; index++){ sum += averageLogReturn[index]; } final double averageSeasonal = sum / averageLogReturn.length;