use of de.lmu.ifi.dbs.elki.math.statistics.distribution.NormalDistribution in project elki by elki-project.
the class NormalLMMEstimatorTest method testEstimator.
@Test
public void testEstimator() {
final NormalLMMEstimator est = instantiate(NormalLMMEstimator.class, NormalDistribution.class);
load("norm.ascii.gz");
double[] data = this.data.get("random_01_01");
NormalDistribution dist = est.estimate(data, DoubleArrayAdapter.STATIC);
assertStat("mean", dist.getMean(), 0.1, -0.01038465173940939);
assertStat("stddev", dist.getStddev(), 0.1, -0.008827779497812646);
data = this.data.get("random_0_1");
dist = est.estimate(data, DoubleArrayAdapter.STATIC);
assertStat("mean", dist.getMean(), 0., -0.02278981436658599);
assertStat("stddev", dist.getStddev(), 1., -0.02088104864887541);
data = this.data.get("random_1_3");
dist = est.estimate(data, DoubleArrayAdapter.STATIC);
assertStat("mean", dist.getMean(), 1., -0.4189550588142462);
assertStat("stddev", dist.getStddev(), 3., 0.24292144344037636);
}
Aggregations