@Test public void testP() { System.out.println("p"); WeibullDistribution instance = new WeibullDistribution(1.5, 1.0); instance.rand(); assertEquals(0.0, instance.p(0.0), 1E-7); assertEquals(0.4595763, instance.p(0.1), 1E-7); assertEquals(0.6134254, instance.p(0.2), 1E-7); assertEquals(0.7447834, instance.p(0.5), 1E-7); assertEquals(0.2926085, instance.p(1.5), 1E-7); assertEquals(0.0455367, instance.p(2.5), 1E-7); assertEquals(4.677527e-05, instance.p(5.0), 1E-10); }
@Override public double p(double x) { if (x <= 0) { return 0.0; } else { return (k / lambda) * Math.pow(x / lambda, k - 1) * Math.exp(-Math.pow(x / lambda, k)); } }
WeibullDistribution extends AbstractDistribution { @Override public double p(double x) { if (x <= 0) { return 0.0; } else { return (k / lambda) * Math.pow(x / lambda, k - 1) * Math.exp(-Math.pow(x / lambda, k)); } } }
WeibullDistribution extends AbstractDistribution { @Override public double p(double x) { if (x <= 0) { return 0.0; } else { return (k / lambda) * Math.pow(x / lambda, k - 1) * Math.exp(-Math.pow(x / lambda, k)); } } WeibullDistribution(double k);  WeibullDistribution(double k, double lambda); }
WeibullDistribution extends AbstractDistribution { @Override public double p(double x) { if (x <= 0) { return 0.0; } else { return (k / lambda) * Math.pow(x / lambda, k - 1) * Math.exp(-Math.pow(x / lambda, k)); } } WeibullDistribution(double k);  WeibullDistribution(double k, double lambda); @Override int length(); @Override double mean(); @Override double variance(); @Override double entropy(); @Override String toString(); @Override double rand(); @Override double p(double x); @Override double logp(double x); @Override double cdf(double x); @Override double quantile(double p); }
WeibullDistribution extends AbstractDistribution { @Override public double p(double x) { if (x <= 0) { return 0.0; } else { return (k / lambda) * Math.pow(x / lambda, k - 1) * Math.exp(-Math.pow(x / lambda, k)); } } WeibullDistribution(double k);  WeibullDistribution(double k, double lambda); @Override int length(); @Override double mean(); @Override double variance(); @Override double entropy(); @Override String toString(); @Override double rand(); @Override double p(double x); @Override double logp(double x); @Override double cdf(double x); @Override double quantile(double p); final double k; final double lambda; }