def p_upper(self, outcome): """ Return probability of getting a value greater than or equal to outcome """ if not ExactTest.is_numeric(outcome): raise TypeError('outcome must be a number') return sum(self.pmf(self.__possible_scores[i]) for i in range(len(self.__possible_scores)) if self.__delta_values[i] >= outcome-self.__expected_value)
def p_two(self, outcome): """ Return probability of getting a value whose distance from the expected value is greater or equal to that of outcome """ if not ExactTest.is_numeric(outcome): raise TypeError('outcome must be a number') return sum(self.pmf(self.__possible_scores[i]) for i in range(len(self.__possible_scores)) if abs(self.__delta_values[i]) >= abs(outcome-self.__expected_value))