def test_chart_computes_control_limits(self):
        chart = ControlChart(SERIES_WITH_UCL_OUTLIERS)

        (lcl, ucl) = chart.control_limits()

        self.assertEquals(lcl, chart.lower_control_limit())
        self.assertEquals(ucl, chart.upper_control_limit())

        self.assertAlmostEqual(lcl, -3.1952, places=4)
        self.assertAlmostEqual(ucl, 3.4809, places=4)
Пример #2
0
    def test_chart_computes_control_limits(self):
        chart = ControlChart(SERIES_WITH_UCL_OUTLIERS)

        (lcl, ucl) = chart.control_limits()

        self.assertEquals(lcl, chart.lower_control_limit())
        self.assertEquals(ucl, chart.upper_control_limit())

        self.assertAlmostEqual(lcl, -3.1952, places=4)
        self.assertAlmostEqual(ucl, 3.4809, places=4)
    def test_series_under_control(self):
        chart = ControlChart(SERIES_UNDER_CONTROL)

        self.assertEquals(10.05, chart.mean())
        self.assertEquals(10.05, chart.median())
        self.assertAlmostEquals(0.8737, chart.std_dev(), places=4)

        self.assertAlmostEquals(7.429, chart.lower_control_limit(), places=3)
        self.assertAlmostEquals(12.671, chart.upper_control_limit(), places=3)

        self.assertEquals([], chart.points_outside_lcl())
        self.assertEquals([], chart.points_outside_ucl())
Пример #4
0
    def test_series_under_control(self):
        chart = ControlChart(SERIES_UNDER_CONTROL)

        self.assertEquals(10.05, chart.mean())
        self.assertEquals(10.05, chart.median())
        self.assertAlmostEquals(0.8737, chart.std_dev(), places=4)

        self.assertAlmostEquals(7.429, chart.lower_control_limit(), places=3)
        self.assertAlmostEquals(12.671, chart.upper_control_limit(), places=3)

        self.assertEquals([], chart.points_outside_lcl())
        self.assertEquals([], chart.points_outside_ucl())