Exemple #1
0
    def test_compound_two_distribution(self):
        """test to be checked"""
        cdist1 = Compound("data/compound1.cd")
        chisto1 = Simulate(cdist1, 200)

        cdist2 = Estimate(chisto1, "COMPOUND",
                      ExtractDistribution(cdist1, "Sum"),
                      "Sum",
                      InitialDistribution=\
                        ExtractDistribution(cdist1, "Elementary"))

        # If we call the method directly, we need to provide
        # the default values and perform a conversion.
        # Default is LIKELIHOOD -1 -1.0 SECOND_DIFFERENCE ZERO, which
        #  corresponds to 0, -1,-1,1,0
        # In addition because the type is 's', the 2 distributions
        # must be reversed.

        cdist3 = chisto1.compound_estimation1(
                    ExtractDistribution(cdist1, "Elementary"),
                    ExtractDistribution(cdist1, "Sum"),
                    's', _stat_tool.LIKELIHOOD, -1, -1.,
                    _stat_tool.SECOND_DIFFERENCE,
                    _stat_tool.ZERO)
        assert str(cdist2) == str(cdist3)