@Test public void lognormal() { validate(Distributions.lognormal(10, 1)); }
public static Distribution lognormal(final double average, final double spread) { checkArgument(average >= 0.0, "average must be >= 0.0 [%s]", average); checkArgument(spread >= 0.0, "spread must be >= 0.0 [%s]", spread); if (DoubleMath.fuzzyEquals(spread, 0.0, Distributions.ERR)) { return constant(average); } final double min = average - (3 * spread); checkArgument(min >= 0.0, "three standard deviations must be >= 0.0 [%s]", min); final String s = String.format("LogNormalDistribution [average=%s, spread=%s]", average, spread); return new RealDistributionAdapter(new LogNormalDistribution(average, spread), s); }
Distributions { public static Distribution lognormal(final double average, final double spread) { checkArgument(average >= 0.0, "average must be >= 0.0 [%s]", average); checkArgument(spread >= 0.0, "spread must be >= 0.0 [%s]", spread); if (DoubleMath.fuzzyEquals(spread, 0.0, Distributions.ERR)) { return constant(average); } final double min = average - (3 * spread); checkArgument(min >= 0.0, "three standard deviations must be >= 0.0 [%s]", min); final String s = String.format("LogNormalDistribution [average=%s, spread=%s]", average, spread); return new RealDistributionAdapter(new LogNormalDistribution(average, spread), s); } }
Distributions { public static Distribution lognormal(final double average, final double spread) { checkArgument(average >= 0.0, "average must be >= 0.0 [%s]", average); checkArgument(spread >= 0.0, "spread must be >= 0.0 [%s]", spread); if (DoubleMath.fuzzyEquals(spread, 0.0, Distributions.ERR)) { return constant(average); } final double min = average - (3 * spread); checkArgument(min >= 0.0, "three standard deviations must be >= 0.0 [%s]", min); final String s = String.format("LogNormalDistribution [average=%s, spread=%s]", average, spread); return new RealDistributionAdapter(new LogNormalDistribution(average, spread), s); } private  Distributions(); }
Distributions { public static Distribution lognormal(final double average, final double spread) { checkArgument(average >= 0.0, "average must be >= 0.0 [%s]", average); checkArgument(spread >= 0.0, "spread must be >= 0.0 [%s]", spread); if (DoubleMath.fuzzyEquals(spread, 0.0, Distributions.ERR)) { return constant(average); } final double min = average - (3 * spread); checkArgument(min >= 0.0, "three standard deviations must be >= 0.0 [%s]", min); final String s = String.format("LogNormalDistribution [average=%s, spread=%s]", average, spread); return new RealDistributionAdapter(new LogNormalDistribution(average, spread), s); } private  Distributions(); static Distribution uniform(final double average, final double spread); static Distribution normal(final double average, final double spread); static Distribution lognormal(final double average, final double spread); static Distribution poisson(final double average); }
Distributions { public static Distribution lognormal(final double average, final double spread) { checkArgument(average >= 0.0, "average must be >= 0.0 [%s]", average); checkArgument(spread >= 0.0, "spread must be >= 0.0 [%s]", spread); if (DoubleMath.fuzzyEquals(spread, 0.0, Distributions.ERR)) { return constant(average); } final double min = average - (3 * spread); checkArgument(min >= 0.0, "three standard deviations must be >= 0.0 [%s]", min); final String s = String.format("LogNormalDistribution [average=%s, spread=%s]", average, spread); return new RealDistributionAdapter(new LogNormalDistribution(average, spread), s); } private  Distributions(); static Distribution uniform(final double average, final double spread); static Distribution normal(final double average, final double spread); static Distribution lognormal(final double average, final double spread); static Distribution poisson(final double average);  }