public void GenerateTest() { LognormalDistribution target = new LognormalDistribution(2, 5); double[] samples = target.Generate(1000000); var actual = LognormalDistribution.Estimate(samples); actual.Fit(samples); Assert.AreEqual(2, actual.Location, 0.01); Assert.AreEqual(5, actual.Shape, 0.01); }
public void GenerateTest2() { LognormalDistribution target = new LognormalDistribution(4, 2); double[] samples = new double[1000000]; for (int i = 0; i < samples.Length; i++) { samples[i] = target.Generate(); } var actual = LognormalDistribution.Estimate(samples); actual.Fit(samples); Assert.AreEqual(4, actual.Location, 0.01); Assert.AreEqual(2, actual.Shape, 0.01); }
public void GenerateTest2() { LognormalDistribution target = new LognormalDistribution(4, 2); double[] samples = new double[1000000]; for (int i = 0; i < samples.Length; i++) samples[i] = target.Generate(); var actual = LognormalDistribution.Estimate(samples); actual.Fit(samples); Assert.AreEqual(4, actual.Location, 0.01); Assert.AreEqual(2, actual.Shape, 0.01); }
public void GenerateTest() { Accord.Math.Tools.SetupGenerator(0); LognormalDistribution target = new LognormalDistribution(2, 5); double[] samples = target.Generate(1000000); var actual = LognormalDistribution.Estimate(samples); actual.Fit(samples); Assert.AreEqual(2, actual.Location, 0.01); Assert.AreEqual(5, actual.Shape, 0.01); }