@Test public void testEntropy() { System.out.println("entropy"); BernoulliDistribution instance = new BernoulliDistribution(0.3); instance.rand(); assertEquals(-0.3* MathEx.log2(0.3) - 0.7* MathEx.log2(0.7), instance.entropy(), 1E-7); }
@Override public double entropy() { return entropy; }
BernoulliDistribution extends DiscreteDistribution { @Override public double entropy() { return entropy; } }
BernoulliDistribution extends DiscreteDistribution { @Override public double entropy() { return entropy; } BernoulliDistribution(double p);  BernoulliDistribution(boolean[] data); }
BernoulliDistribution extends DiscreteDistribution { @Override public double entropy() { return entropy; } BernoulliDistribution(double p);  BernoulliDistribution(boolean[] data); static BernoulliDistribution fit(int[] data); @Override int length(); @Override double mean(); @Override double variance(); @Override double entropy(); @Override String toString(); @Override double rand(); @Override double p(int k); @Override double logp(int k); @Override double cdf(double k); @Override double quantile(double p); }
BernoulliDistribution extends DiscreteDistribution { @Override public double entropy() { return entropy; } BernoulliDistribution(double p);  BernoulliDistribution(boolean[] data); static BernoulliDistribution fit(int[] data); @Override int length(); @Override double mean(); @Override double variance(); @Override double entropy(); @Override String toString(); @Override double rand(); @Override double p(int k); @Override double logp(int k); @Override double cdf(double k); @Override double quantile(double p); final double p; final double q; }