public void CanCreateBetaScaled(double a, double b, double location, double scale)
 {
     var n = new BetaScaled(a, b, location, scale);
     Assert.AreEqual(a, n.A);
     Assert.AreEqual(b, n.B);
     Assert.AreEqual(location, n.Location);
     Assert.AreEqual(scale, n.Scale);
 }
 public void CanSample()
 {
     var n = new BetaScaled(2.0, 3.0, 0.0, 1.0);
     n.Sample();
 }
 public void ValidateSkewness(double a, double b, double location, double scale, double skewness)
 {
     var n = new BetaScaled(a, b, location, scale);
     AssertHelpers.AlmostEqualRelative(skewness, n.Skewness, 14);
 }
 public void ValidateToString()
 {
     var n = new BetaScaled(1d, 2d, 0.0, 1.0);
     Assert.AreEqual("BetaScaled(α = 1, β = 2, μ = 0, σ = 1)", n.ToString());
 }
 public void ValidateMinimum()
 {
     var n = new BetaScaled(1.0, 1.0, 0.0, 1.0);
     Assert.AreEqual(0.0, n.Minimum);
 }
 public void ValidateMode(double a, double b, double location, double scale, double mode)
 {
     var n = new BetaScaled(a, b, location, scale);
     Assert.AreEqual(mode, n.Mode);
 }
 public void ValidateMedianThrowsNotSupportedException()
 {
     var n = new BetaScaled(1.0, 1.0, 0.0, 1.0);
     Assert.Throws<NotSupportedException>(() => { var m = n.Median; });
 }
 public void ValidateMean(double a, double b, double location, double scale, double mean)
 {
     var n = new BetaScaled(a, b, location, scale);
     Assert.AreEqual(mean, n.Mean);
 }
 public void ValidateInverseCumulativeDistribution(double a, double b, double location, double scale, double x, double p)
 {
     var dist = new BetaScaled(a, b, location, scale);
     Assert.That(dist.InverseCumulativeDistribution(p), Is.EqualTo(x).Within(1e-6));
     Assert.That(BetaScaled.InvCDF(a, b, location, scale, p), Is.EqualTo(x).Within(1e-6));
 }
Esempio n. 10
0
 public void ValidateDensityLn(double a, double b, double location, double scale, double x, double pdfln)
 {
     var n = new BetaScaled(a, b, location, scale);
     AssertHelpers.AlmostEqualRelative(pdfln, n.DensityLn(x), 5);
     AssertHelpers.AlmostEqualRelative(pdfln, BetaScaled.PDFLn(a, b, location, scale, x), 5);
 }
Esempio n. 11
0
 public void CanSampleSequence()
 {
     var n = new BetaScaled(2.0, 3.0, 0.0, 1.0);
     var ied = n.Samples();
     GC.KeepAlive(ied.Take(5).ToArray());
 }