public void ValidateDistributionPropertiesByStDev([Values(-0.0, 0.0, 0.1, 1.0, 10.0, Double.PositiveInfinity)] double stdev) { var normal = new Normal(1.0, stdev); normal.Entropy.Should().Be(Math.Log(normal.StDev) + MathTool.LnSqrtPi2E); normal.Skewness.Should().Be(0.0); }
public void ValidateDistributionPropertiesByMean([Values(-0.0, 0.0, 0.1, 1.0, 10.0, Double.PositiveInfinity)] double mean) { var normal = new Normal(mean, 1.0); normal.Mean.Should().Be(mean); normal.Median.Should().Be(mean); normal.Minumum.Should().Be(double.NegativeInfinity); normal.Maximum.Should().Be(double.PositiveInfinity); }
public void SetStDevFailsWithNegativeStDev() { var n = new Normal(); Assert.Throws<InvalidOperationException>(() => n.StDev = -1.0); }
public void SetVarianceFailsWithNegativeVariance() { var n = new Normal(); Assert.Throws<InvalidOperationException>(() => n.Variance = -1.0); }
public void SetPrecisionFailsWithNegativePrecision() { var n = new Normal(); Assert.Throws<InvalidOperationException>(() => n.Precision = -1.0); }
public void CreateNormal([Values(0.0, 10.0, -5.0)] double mean, [Values(0.0, 0.1, 1.0, 10.0, 100.0, double.PositiveInfinity)] double stdev) { var normal = new Normal(mean, stdev); normal.Mean.Should().Be(mean); normal.StDev.Should().Be(stdev); }
public void CreateStandardNormalDistribution() { var normal = new Normal(); normal.Mean.Should().Be(0.0); normal.StDev.Should().Be(1.0); }