@Test public void testMean() { System.out.println("mean"); HyperGeometricDistribution instance = new HyperGeometricDistribution(100, 30, 70); instance.rand(); assertEquals(21, instance.mean(), 1E-7); instance = new HyperGeometricDistribution(100, 30, 80); instance.rand(); assertEquals(24, instance.mean(), 1E-7); instance = new HyperGeometricDistribution(100, 30, 60); instance.rand(); assertEquals(18, instance.mean(), 1E-7); }
@Override public double mean() { return (double) m * n / N; }
HyperGeometricDistribution extends DiscreteDistribution { @Override public double mean() { return (double) m * n / N; } }
HyperGeometricDistribution extends DiscreteDistribution { @Override public double mean() { return (double) m * n / N; } HyperGeometricDistribution(int N, int m, int n); }
HyperGeometricDistribution extends DiscreteDistribution { @Override public double mean() { return (double) m * n / N; } HyperGeometricDistribution(int N, int m, int n); @Override int length(); @Override double mean(); @Override double variance(); @Override double entropy(); @Override String toString(); @Override double p(int k); @Override double logp(int k); @Override double cdf(double k); @Override double quantile(double p); @Override double rand(); }
HyperGeometricDistribution extends DiscreteDistribution { @Override public double mean() { return (double) m * n / N; } HyperGeometricDistribution(int N, int m, int n); @Override int length(); @Override double mean(); @Override double variance(); @Override double entropy(); @Override String toString(); @Override double p(int k); @Override double logp(int k); @Override double cdf(double k); @Override double quantile(double p); @Override double rand(); final int N; final int m; final int n; }