Beispiel #1
0
    def test_trivial_curve(self):
        curve = numpy.array(
            [numpy.linspace(0, 1, 11), numpy.zeros(11)])

        numpy.testing.assert_allclose(
            [[0, 0.1, 0.2, 0.3, 0.4, 0.5],
             [0, 0, 0, 0, 0, 0]],
            scientific.insured_loss_curve(curve, 0.1, 0.5))
    def test_trivial_curve(self):
        curve = numpy.array(
            [numpy.linspace(0, 1, 11), numpy.zeros(11)])

        numpy.testing.assert_allclose(
            [[0, 0.1, 0.2, 0.3, 0.4, 0.5],
             [0, 0, 0, 0, 0, 0]],
            scientific.insured_loss_curve(curve, 0.1, 0.5))
Beispiel #3
0
    def test_curve(self):
        curve = numpy.array(
            [numpy.linspace(0, 1, 11), numpy.linspace(1, 0, 11)])

        numpy.testing.assert_allclose(
            numpy.array([[0., 0.1, 0.2, 0.3, 0.4, 0.5],
                         [0.8, 0.8, 0.8, 0.7, 0.6, 0.5]]),
            scientific.insured_loss_curve(curve, 0.2, 0.5))
    def test_curve(self):
        curve = numpy.array(
            [numpy.linspace(0, 1, 11), numpy.linspace(1, 0, 11)])

        numpy.testing.assert_allclose(
            numpy.array([[0., 0.1, 0.2, 0.3, 0.4, 0.5],
                         [0.8, 0.8, 0.8, 0.7, 0.6, 0.5]]),
            scientific.insured_loss_curve(curve, 0.2, 0.5))