public void ValidateCumulativeDistribution(double shape, double scale, double x, double cdf)
        {
            var n = new Weibull(shape, scale);

            AssertHelpers.AlmostEqualRelative(cdf, n.CumulativeDistribution(x), 14);
        }
Beispiel #2
0
        public void ValidateSkewness(double shape, double invScale, double skewness)
        {
            var n = new Gamma(shape, invScale);

            AssertHelpers.AlmostEqualRelative(skewness, n.Skewness, 15);
        }
Beispiel #3
0
        public void ValidateMean(double a, double c, double k, double mean)
        {
            var n = new Burr(a, c, k);

            AssertHelpers.AlmostEqualRelative(mean, n.Mean, highPrecision);
        }
Beispiel #4
0
        public void ValidateCumulativeDistribution(double alpha, double beta, double scale, double location, double x, double cdf)
        {
            var n = new Stable(alpha, beta, scale, location);

            AssertHelpers.AlmostEqualRelative(cdf, n.CumulativeDistribution(x), 15);
        }
Beispiel #5
0
        public void ValidateStdDev(double shape, double invScale, double sdev)
        {
            var n = new Gamma(shape, invScale);

            AssertHelpers.AlmostEqualRelative(sdev, n.StdDev, 15);
        }
Beispiel #6
0
        public void ValidateEntropy(double p)
        {
            var b = new Bernoulli(p);

            AssertHelpers.AlmostEqualRelative(-((1.0 - p) * Math.Log(1.0 - p)) - (p * Math.Log(p)), b.Entropy, 14);
        }
Beispiel #7
0
        public void ValidateSkewness(double a, double b, double skewness)
        {
            var n = new Beta(a, b);

            AssertHelpers.AlmostEqualRelative(skewness, n.Skewness, 14);
        }
        public void ValidateDensityLn(double location, double scale, double dof, double x, double p)
        {
            var n = new StudentT(location, scale, dof);

            AssertHelpers.AlmostEqualRelative(p, n.DensityLn(x), 13);
        }
Beispiel #9
0
        public void ValidateEntropy(double s, int n, double e)
        {
            var d = new Zipf(s, n);

            AssertHelpers.AlmostEqualRelative(e, d.Entropy, 15);
        }
        public void ValidateMoments(double scale, double shape, double truncation, int order, double value)
        {
            var n = new TruncatedPareto(scale, shape, truncation);

            AssertHelpers.AlmostEqualRelative(value, n.GetMoment(order), highPrecision);
        }
        public void ValidateSkewness(double scale, double shape, double truncation, double skewness)
        {
            var n = new TruncatedPareto(scale, shape, truncation);

            AssertHelpers.AlmostEqualRelative(skewness, n.Skewness, highPrecision);
        }
        public void ValidateStandardDeviation(double scale, double shape, double truncation, double std)
        {
            var n = new TruncatedPareto(scale, shape, truncation);

            AssertHelpers.AlmostEqualRelative(std, n.StdDev, highPrecision);
        }
        public void ValidateVariance(double scale, double shape, double truncation, double variance)
        {
            var n = new TruncatedPareto(scale, shape, truncation);

            AssertHelpers.AlmostEqualRelative(variance, n.Variance, highPrecision);
        }
        public void ValidateMean(double scale, double shape, double truncation, double mean)
        {
            var n = new TruncatedPareto(scale, shape, truncation);

            AssertHelpers.AlmostEqualRelative(mean, n.Mean, highPrecision);
        }
Beispiel #15
0
 public void ErfcCanMatchLargePrecision(double x, double f)
 {
     AssertHelpers.AlmostEqualRelative(f, SpecialFunctions.Erfc(x), 13);
 }
 public void StruveL1Exact(double x, double expected)
 {
     AssertHelpers.AlmostEqualRelative(expected, SpecialFunctions.StruveL1(x), 14);
 }
Beispiel #17
0
        public void CanComputeNormP(int p, double expected)
        {
            var vector = CreateVector(Data);

            AssertHelpers.AlmostEqualRelative(expected, vector.Norm(p), 14);
        }
 //[TestCase(100.0, 0.636556)] Needs direct approximation
 public void BesselI1MStruveL1Exact(double x, double expected)
 {
     // Abramowitz/Stegun Table 12.1, 12.2
     AssertHelpers.AlmostEqualRelative(expected, SpecialFunctions.BesselI1MStruveL1(x), 5);
 }
Beispiel #19
0
        public void ValidateEntropy(double a, double b, double entropy)
        {
            var n = new Beta(a, b);

            AssertHelpers.AlmostEqualRelative(entropy, n.Entropy, 13);
        }
Beispiel #20
0
        public void ValidateEntropy(int l, int u, double e)
        {
            var du = new DiscreteUniform(l, u);

            AssertHelpers.AlmostEqualRelative(e, du.Entropy, 14);
        }
Beispiel #21
0
        public void ValidateDensityLn(double alpha, double beta, double scale, double location, double x, double dln)
        {
            var n = new Stable(alpha, beta, scale, location);

            AssertHelpers.AlmostEqualRelative(dln, n.DensityLn(x), 15);
        }
        public void ValidateProbabilityLn(double p, int n, int x, double dln)
        {
            var b = new Binomial(p, n);

            AssertHelpers.AlmostEqualRelative(dln, b.ProbabilityLn(x), 14);
        }
Beispiel #23
0
        public void ValidateVariance(double shape, double invScale, double var)
        {
            var n = new Gamma(shape, invScale);

            AssertHelpers.AlmostEqualRelative(var, n.Variance, 15);
        }
        public void ValidateEntropy(double p, int n, double e)
        {
            var b = new Binomial(p, n);

            AssertHelpers.AlmostEqualRelative(e, b.Entropy, 14);
        }
Beispiel #25
0
        public void ValidateEntropy(double shape, double invScale, double entropy)
        {
            var n = new Gamma(shape, invScale);

            AssertHelpers.AlmostEqualRelative(entropy, n.Entropy, 12);
        }
        public void CanComputeDotProduct()
        {
            var result = Control.LinearAlgebraProvider.DotProduct(_x, _y);

            AssertHelpers.AlmostEqualRelative(152.35, result, 15);
        }
Beispiel #27
0
        public void ValidateMode(double a, double c, double k, double mode)
        {
            var n = new Burr(a, c, k);

            AssertHelpers.AlmostEqualRelative(mode, n.Mode, highPrecision);
        }
Beispiel #28
0
 public void ErfInv(double x, double f)
 {
     AssertHelpers.AlmostEqualRelative(x, SpecialFunctions.ErfInv(f), 5);
 }
Beispiel #29
0
        public void ValidateVariance(double a, double c, double k, double variance)
        {
            var n = new Burr(a, c, k);

            AssertHelpers.AlmostEqualRelative(variance, n.Variance, highPrecision);
        }
        public void ValidateDensityLn(double shape, double scale, double x, double pdfln)
        {
            var n = new Weibull(shape, scale);

            AssertHelpers.AlmostEqualRelative(pdfln, n.DensityLn(x), 14);
        }