public void ValidateCumulativeDistribution(double a, double b, double x, double p) { var dist = new Beta(a, b); Assert.That(dist.CumulativeDistribution(x), Is.EqualTo(p).Within(1e-13)); Assert.That(Beta.CDF(a, b, x), Is.EqualTo(p).Within(1e-13)); }
public void ValidateCumulativeDistribution(double a, double b, double x, double cdf) { var n = new Beta(a, b); AssertHelpers.AlmostEqualRelative(cdf, n.CumulativeDistribution(x), 13); AssertHelpers.AlmostEqualRelative(cdf, Beta.CDF(a, b, x), 13); }
public double doCalc(double x) { if (x > 0) { return(Beta.CDF(_positiveAlpha, _positiveBeta, x)); } else if (x < 0) { return((-1) * Beta.CDF(_negativeAlpha, _negativeBeta, (-1) * x)); } return(x); }
public static double BetaDist(double x, double alpha, double beta) { return(Beta.CDF(alpha, beta, x)); }