@Test
public void linearDataExtrapolatesLinearValues() {

	double[] data = new double[100];
	for (int i = 0; i < data.length; ++i)
		data[i] = -0.25 * i;
	final LoessInterpolator.Builder builder = new LoessInterpolator.Builder();
	for (int degree = 1; degree < 3; ++degree) {
		LoessInterpolator loess = builder.setWidth(7).setDegree(degree).interpolate(data);
		Double y = loess.smoothOnePoint(-100, 0, data.length - 1);
		assertNotNull(y);
		assertEquals("Bad value extrapolating left", -0.25 * -100, y, 1.0e-8);
		y = loess.smoothOnePoint(1000.0, 0, data.length - 1);
		assertNotNull(y);
		assertEquals("Bad value extrapolating right", -0.25 * 1000, y, 1.0e-8);
	}
}