@Test public void testSetState() throws Exception { Normal dist = new Normal(0, 1, RandomUtils.getRandom()); dist.setState(1.3, 5.9); DistributionChecks.checkDistribution(dist, breaks, 1.3, 5.9, 10000); }
public final void setState(double mean, double standardDeviation) { if (mean != this.mean || standardDeviation != this.standardDeviation) { this.mean = mean; this.standardDeviation = standardDeviation; this.variance = standardDeviation * standardDeviation; this.cacheFilled = false; this.normalizer = 1.0 / Math.sqrt(2.0 * Math.PI * variance); } }
Normal extends AbstractContinousDistribution { public final void setState(double mean, double standardDeviation) { if (mean != this.mean || standardDeviation != this.standardDeviation) { this.mean = mean; this.standardDeviation = standardDeviation; this.variance = standardDeviation * standardDeviation; this.cacheFilled = false; this.normalizer = 1.0 / Math.sqrt(2.0 * Math.PI * variance); } } }
Normal extends AbstractContinousDistribution { public final void setState(double mean, double standardDeviation) { if (mean != this.mean || standardDeviation != this.standardDeviation) { this.mean = mean; this.standardDeviation = standardDeviation; this.variance = standardDeviation * standardDeviation; this.cacheFilled = false; this.normalizer = 1.0 / Math.sqrt(2.0 * Math.PI * variance); } } Normal(double mean, double standardDeviation, Random randomGenerator); }
Normal extends AbstractContinousDistribution { public final void setState(double mean, double standardDeviation) { if (mean != this.mean || standardDeviation != this.standardDeviation) { this.mean = mean; this.standardDeviation = standardDeviation; this.variance = standardDeviation * standardDeviation; this.cacheFilled = false; this.normalizer = 1.0 / Math.sqrt(2.0 * Math.PI * variance); } } Normal(double mean, double standardDeviation, Random randomGenerator); @Override double cdf(double x); @Override double pdf(double x); @Override double nextDouble(); @Override final void setRandomGenerator(Random randomGenerator); final void setState(double mean, double standardDeviation); @Override String toString(); }
Normal extends AbstractContinousDistribution { public final void setState(double mean, double standardDeviation) { if (mean != this.mean || standardDeviation != this.standardDeviation) { this.mean = mean; this.standardDeviation = standardDeviation; this.variance = standardDeviation * standardDeviation; this.cacheFilled = false; this.normalizer = 1.0 / Math.sqrt(2.0 * Math.PI * variance); } } Normal(double mean, double standardDeviation, Random randomGenerator); @Override double cdf(double x); @Override double pdf(double x); @Override double nextDouble(); @Override final void setRandomGenerator(Random randomGenerator); final void setState(double mean, double standardDeviation); @Override String toString();  }