@Test
public void robustRegressionTest() {

	// Check results against a Python/Fortran test on noisy/trendy/sinusoidal data.
	double[] data = new double[144];
	for (int i = 0; i < data.length; ++i) {
		data[i] = fRobustNoisySinusoidResults[i][0];
	}
	SeasonalTrendLoess.Builder builder = new SeasonalTrendLoess.Builder().setPeriodLength(12).setSeasonalWidth(7);
	builder.setInnerIterations(1).setRobustnessIterations(1);
	SeasonalTrendLoess smoother = builder.buildSmoother(data);
	SeasonalTrendLoess.Decomposition stl = smoother.decompose();
	// TODO: The differences here are larger than I had expected. They're quite small but significantly larger than
	// machine epsilon, and looking at the difference between the seasonality from Java and Python/Fortran shows
	// some spurious stuff at the right boundary. Investigate in the future.
	double epsilon = 2.0e-07; // Doing absolute differences and some values > 10
	double[] trend = stl.getTrend();
	double[] seasonal = stl.getSeasonal();
	double[] residuals = stl.getResidual();
	for (int i = 0; i < data.length; ++i) {
		assertEquals(String.format("seasonal[%d]", i), fRobustNoisySinusoidResults[i][1], trend[i], epsilon);
		assertEquals(String.format("trend[%d]", i), fRobustNoisySinusoidResults[i][2], seasonal[i], epsilon);
		assertEquals(String.format("residuals[%d]", i), fRobustNoisySinusoidResults[i][3], residuals[i],
				epsilon);
	}
}