use of de.lmu.ifi.dbs.elki.math.statistics.distribution.LogNormalDistribution in project elki by elki-project.
the class LogNormalLMMEstimatorTest method testEstimator.
@Test
public void testEstimator() {
final LogNormalLMMEstimator est = instantiate(LogNormalLMMEstimator.class, LogNormalDistribution.class);
load("lognorm.ascii.gz");
LogNormalDistribution dist;
double[] data;
data = this.data.get("random_0_1");
dist = est.estimate(data, DoubleArrayAdapter.STATIC);
assertStat("logmean", dist.getLogMean(), 0, 0.01293860693389489);
assertStat("stddev", dist.getLogStddev(), 1, 0.014406334407070176);
assertStat("shift", dist.getShift(), 0., 0.01974990703517232);
data = this.data.get("random_01_01");
dist = est.estimate(data, DoubleArrayAdapter.STATIC);
assertStat("logmean", dist.getLogMean(), 0.1, -0.33576293434476867);
assertStat("stddev", dist.getLogStddev(), 0.1, 0.028259826748252476);
assertStat("shift", dist.getShift(), 0., 0.2981416393562042);
data = this.data.get("random_1_3");
dist = est.estimate(data, DoubleArrayAdapter.STATIC);
assertStat("logmean", dist.getLogMean(), 1., 0.7277441888716416);
assertStat("stddev", dist.getLogStddev(), 3., -0.949904959684531);
assertStat("shift", dist.getShift(), 0., -1.3443264773354375);
}
Aggregations