@Test
public void testTwoSampleTHeterscedastic() {
double[] sample1 = { 7d, -4d, 18d, 17d, -3d, -5d, 1d, 10d, 11d, -2d };
double[] sample2 = { -1d, 12d, -1d, -3d, 3d, -5d, 5d, 2d, -11d, -1d, -3d };
SummaryStatistics sampleStats1 = new SummaryStatistics();
for (int i = 0; i < sample1.length; i++) {
sampleStats1.addValue(sample1[i]);
}
SummaryStatistics sampleStats2 = new SummaryStatistics();
for (int i = 0; i < sample2.length; i++) {
sampleStats2.addValue(sample2[i]);
}
// Target comparison values computed using R version 1.8.1 (Linux version)
Assert.assertEquals("two sample heteroscedastic t stat", 1.60371728768,
TestUtils.t(sample1, sample2), 1E-10);