Beispiel #1
0
    def scoreZValue(self, syncNumber, get):
        """Score one event with a zValue testStatistic (non-Gaussian)."""

        value = get(self.field)
        if value is INVALID or value is MISSING:
            return INVALID

        probability = self.baseline.cdf(value)
        if probability <= 1e-16:
            zValue = -10.
        elif probability >= 1. - 1e-16:
            zValue = 10.
        else:
            zValue = math.sqrt(2.) * erfinv(2. * probability - 1.)
        pValue = 1. - 2. * abs(probability - 0.5)

        return {SCORE_predictedValue: zValue, SCORE_pValue: pValue}
Beispiel #2
0
    def scoreZValue(self, syncNumber, get):
        """Score one event with a zValue testStatistic (non-Gaussian)."""

        value = get(self.field)
        if value is INVALID or value is MISSING:
            return INVALID

        probability = self.baseline.cdf(value)
        if probability <= 1e-16:
            zValue = -10.0
        elif probability >= 1.0 - 1e-16:
            zValue = 10.0
        else:
            zValue = math.sqrt(2.0) * erfinv(2.0 * probability - 1.0)
        pValue = 1.0 - 2.0 * abs(probability - 0.5)

        return {SCORE_predictedValue: zValue, SCORE_pValue: pValue}
Beispiel #3
0
    def scoreZValue(self, syncNumber, get):
        """Score one event with a zValue testStatistic (non-Gaussian)."""

        self.resetLoggerLevels()
        value = get(self.field)
        if value is INVALID or value is MISSING:
            self.lastScore = INVALID
            self.logger.debug("scoreZValue: returning INVALID score")
            return self.lastScore

        probability = self.baseline.cdf(value)
        if probability <= 1e-16:
            zValue = -10.
        elif probability >= 1. - 1e-16:
            zValue = 10.
        else:
            zValue = math.sqrt(2.)*erfinv(2.*probability - 1.)
        pValue = 1. - 2.*abs(probability - 0.5)

        self.lastScore = {SCORE_predictedValue: zValue, SCORE_pValue: pValue}
        return self.lastScore
Beispiel #4
0
    def scoreZValue(self, syncNumber, get):
        """Score one event with a zValue testStatistic (non-Gaussian)."""

        self.resetLoggerLevels()
        value = get(self.field)
        if value is INVALID or value is MISSING:
            self.lastScore = INVALID
            self.logger.debug("scoreZValue: returning INVALID score")
            return self.lastScore

        probability = self.baseline.cdf(value)
        if probability <= 1e-16:
            zValue = -10.
        elif probability >= 1. - 1e-16:
            zValue = 10.
        else:
            zValue = math.sqrt(2.)*erfinv(2.*probability - 1.)
        pValue = 1. - 2.*abs(probability - 0.5)

        self.lastScore = {SCORE_predictedValue: zValue, SCORE_pValue: pValue}
        return self.lastScore