public void IrregularQuantilesTest() { var iq = new IrregularQuantiles(new double[] { 0, 0.4, 1 }, new double[] { 3, 4, 5 }); Assert.Equal(3.25, iq.GetQuantile(0.1)); Assert.Equal(0.1, iq.GetProbLessThan(3.25)); CheckGetQuantile(iq, iq); }
public void IrregularQuantiles_InfinityTest() { Assert.Throws <ArgumentOutOfRangeException>(() => { var iq = new IrregularQuantiles(new double[] { 0, 0.4, 1 }, new double[] { double.NegativeInfinity, 4, double.PositiveInfinity }); Assert.Equal(3.25, iq.GetQuantile(0.1)); Assert.Equal(0.1, iq.GetProbLessThan(3.25)); }); }
public void OuterQuantiles_HandlesExtremeValues() { OuterQuantiles outer = new OuterQuantiles(new[] { -double.MaxValue, double.MaxValue }); IrregularQuantiles irregular = new IrregularQuantiles(new[] { 0.0, 1.0 }, new[] { -double.MaxValue, double.MaxValue }); foreach (var example in new[] {