@Test public void testObserveAndTrain() { checkObserveAndTrain(HoltWintersSeasonalityType.MULTIPLICATIVE, HoltWintersAustouristsTestHelper.MULT_LEVEL, HoltWintersAustouristsTestHelper.MULT_BASE, HoltWintersAustouristsTestHelper.MULT_SEASONAL); checkObserveAndTrain(HoltWintersSeasonalityType.ADDITIVE, HoltWintersAustouristsTestHelper.ADD_LEVEL, HoltWintersAustouristsTestHelper.ADD_BASE, HoltWintersAustouristsTestHelper.ADD_SEASONAL); }
public void observeAndTrain(double y, HoltWintersPointForecasterParams params, HoltWintersOnlineComponents components) { checkNulls(params, components); checkTrainingMethod(params); checkStillInInitialTraining(params); int frequency = params.getFrequency(); if (isBetween(n, 0, frequency - 1)) { firstCycle[n] = y; } else { secondCycle[n - frequency] = y; } if (n == params.calculateInitTrainingPeriod() - 1) { setLevel(components); setSeasonals(y, params, components); setBase(params, components); updateComponentsAndForecast(params, components); } n++; }
HoltWintersSimpleTrainingModel { public void observeAndTrain(double y, HoltWintersPointForecasterParams params, HoltWintersOnlineComponents components) { checkNulls(params, components); checkTrainingMethod(params); checkStillInInitialTraining(params); int frequency = params.getFrequency(); if (isBetween(n, 0, frequency - 1)) { firstCycle[n] = y; } else { secondCycle[n - frequency] = y; } if (n == params.calculateInitTrainingPeriod() - 1) { setLevel(components); setSeasonals(y, params, components); setBase(params, components); updateComponentsAndForecast(params, components); } n++; } }
HoltWintersSimpleTrainingModel { public void observeAndTrain(double y, HoltWintersPointForecasterParams params, HoltWintersOnlineComponents components) { checkNulls(params, components); checkTrainingMethod(params); checkStillInInitialTraining(params); int frequency = params.getFrequency(); if (isBetween(n, 0, frequency - 1)) { firstCycle[n] = y; } else { secondCycle[n - frequency] = y; } if (n == params.calculateInitTrainingPeriod() - 1) { setLevel(components); setSeasonals(y, params, components); setBase(params, components); updateComponentsAndForecast(params, components); } n++; } HoltWintersSimpleTrainingModel(HoltWintersPointForecasterParams params); }
HoltWintersSimpleTrainingModel { public void observeAndTrain(double y, HoltWintersPointForecasterParams params, HoltWintersOnlineComponents components) { checkNulls(params, components); checkTrainingMethod(params); checkStillInInitialTraining(params); int frequency = params.getFrequency(); if (isBetween(n, 0, frequency - 1)) { firstCycle[n] = y; } else { secondCycle[n - frequency] = y; } if (n == params.calculateInitTrainingPeriod() - 1) { setLevel(components); setSeasonals(y, params, components); setBase(params, components); updateComponentsAndForecast(params, components); } n++; } HoltWintersSimpleTrainingModel(HoltWintersPointForecasterParams params); void observeAndTrain(double y, HoltWintersPointForecasterParams params, HoltWintersOnlineComponents components); boolean isTrainingComplete(HoltWintersPointForecasterParams params); }
HoltWintersSimpleTrainingModel { public void observeAndTrain(double y, HoltWintersPointForecasterParams params, HoltWintersOnlineComponents components) { checkNulls(params, components); checkTrainingMethod(params); checkStillInInitialTraining(params); int frequency = params.getFrequency(); if (isBetween(n, 0, frequency - 1)) { firstCycle[n] = y; } else { secondCycle[n - frequency] = y; } if (n == params.calculateInitTrainingPeriod() - 1) { setLevel(components); setSeasonals(y, params, components); setBase(params, components); updateComponentsAndForecast(params, components); } n++; } HoltWintersSimpleTrainingModel(HoltWintersPointForecasterParams params); void observeAndTrain(double y, HoltWintersPointForecasterParams params, HoltWintersOnlineComponents components); boolean isTrainingComplete(HoltWintersPointForecasterParams params);  }