@Test(expectedExceptions = IllegalArgumentException.class) public void testBadConstructor() { new GeneralizedExtremeValueDistribution(MU, -SIGMA, KSI); }
@Test public void testObject() { assertEquals(MU, DIST.getMu(), 0); assertEquals(SIGMA, DIST.getSigma(), 0); assertEquals(KSI, DIST.getKsi(), 0); GeneralizedExtremeValueDistribution other = new GeneralizedExtremeValueDistribution(MU, SIGMA, KSI); assertEquals(DIST, other); assertEquals(DIST.hashCode(), other.hashCode()); other = new GeneralizedExtremeValueDistribution(MU + 1, SIGMA, KSI); assertFalse(other.equals(DIST)); other = new GeneralizedExtremeValueDistribution(MU, SIGMA + 1, KSI); assertFalse(other.equals(DIST)); other = new GeneralizedExtremeValueDistribution(MU, SIGMA, KSI + 1); assertFalse(other.equals(DIST)); }
@Test public void testSupport() { ProbabilityDistribution<Double> dist = new GeneralizedExtremeValueDistribution(MU, SIGMA, KSI); double limit = MU - SIGMA / KSI; assertLimit(dist, limit - EPS); assertEquals(dist.getCDF(limit + EPS), 0, EPS); assertEquals(dist.getCDF(LARGE_X), 1, EPS); dist = new GeneralizedExtremeValueDistribution(MU, SIGMA, -KSI); limit = MU + SIGMA / KSI; assertLimit(dist, limit + EPS); assertEquals(dist.getCDF(-LARGE_X), 0, EPS); assertEquals(dist.getCDF(limit - EPS), 1, EPS); dist = new GeneralizedExtremeValueDistribution(MU, SIGMA, 0); assertEquals(dist.getCDF(-LARGE_X), 0, EPS); assertEquals(dist.getCDF(LARGE_X), 1, EPS); }