@Test public void testVariance() { System.out.println("variance"); BinomialDistribution instance = new BinomialDistribution(100, 0.3); instance.rand(); assertEquals(21.0, instance.variance(), 1E-7); }
@Override public double variance() { return n * p * (1 - p); }
BinomialDistribution extends DiscreteDistribution { @Override public double variance() { return n * p * (1 - p); } }
BinomialDistribution extends DiscreteDistribution { @Override public double variance() { return n * p * (1 - p); } BinomialDistribution(int n, double p); }
BinomialDistribution extends DiscreteDistribution { @Override public double variance() { return n * p * (1 - p); } BinomialDistribution(int n, double p); @Override int length(); @Override double mean(); @Override double variance(); @Override double sd(); @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(); }
BinomialDistribution extends DiscreteDistribution { @Override public double variance() { return n * p * (1 - p); } BinomialDistribution(int n, double p); @Override int length(); @Override double mean(); @Override double variance(); @Override double sd(); @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 double p; final int n; }