class SeasonalTrendLoess {

	public Decomposition decompose() {
		// TODO: Pass input data to decompose and reallocate buffers based on that size.

		fDecomposition = new Decomposition(fData);

		int outerIteration = 0;
		while (true) {

			boolean useResidualWeights = outerIteration > 0;

			for (int iteration = 0; iteration < fInnerIterations; ++iteration) {
				smoothSeasonalSubCycles(useResidualWeights);
				removeSeasonality();
				updateSeasonalAndTrend(useResidualWeights);
			}

			if (++outerIteration > fRobustIterations)
				break;

			fDecomposition.computeResidualWeights();
		}

		fDecomposition.updateResiduals();

		Decomposition result = fDecomposition;

		fDecomposition = null;

		return result;
	}

	@SuppressWarnings("WeakerAccess")  SeasonalTrendLoess(double[] data, int periodicity, int ni, int no, LoessSettings seasonalSettings,
	                   LoessSettings trendSettings, LoessSettings lowpassSettings);

}