@staticmethod
def _compare_hist_using_probability_distribution(inferring_hist_cats,
    contender_hist_cats):
    """
        calculate overlap score for given dict of bin and edges
        :param inferring_hist_cats: inference dict of bin to edges.
        :param contender_hist_cats: contender dict of bin to edges.
        """
    if not isinstance(inferring_hist_cats, dict):
        raise Exception(
            'two objects cannot be compared as inferring_hist_cats is not dict type'
            )
    if not isinstance(contender_hist_cats, dict):
        raise Exception(
            'two objects cannot be compared as contender_hist_cats is not dict type'
            )
    score = 0.0
    sum_of_mult_of_both_hist_count = 0.0
    sum_of_square_of_contender_hist_count = 0.0
    sum_of_contender_hist_count = 0.0
    sum_of_inferenced_hist_count = 0.0
    total_categories = list(set(inferring_hist_cats.keys()) | set(
        contender_hist_cats.keys()))
    for each_cat in total_categories:
        contender_hist_count = contender_hist_cats.get(each_cat, 0.0)
        inf_hist_count = inferring_hist_cats.get(each_cat, 0.0)
        sum_of_contender_hist_count += contender_hist_count
        sum_of_inferenced_hist_count += inf_hist_count
        sum_of_mult_of_both_hist_count += contender_hist_count * inf_hist_count
        sum_of_square_of_contender_hist_count += (contender_hist_count *
            contender_hist_count)
    if (sum_of_contender_hist_count <= 1.0 and sum_of_inferenced_hist_count <=
        1.0):
        max_normalized_categories_count = 1.0
        remaining_contender_hist_count = (max_normalized_categories_count -
            sum_of_contender_hist_count)
        remaining_inferenced_hist_count = (max_normalized_categories_count -
            sum_of_inferenced_hist_count)
        sum_of_contender_hist_count = max_normalized_categories_count
        sum_of_inferenced_hist_count = max_normalized_categories_count
        sum_of_mult_of_both_hist_count += (remaining_contender_hist_count *
            remaining_inferenced_hist_count)
        sum_of_square_of_contender_hist_count += (
            remaining_contender_hist_count * remaining_contender_hist_count)
    if (sum_of_square_of_contender_hist_count != 0 and 
        sum_of_contender_hist_count != 0 and sum_of_inferenced_hist_count != 0
        ):
        contender_hist_reference_value = (sum_of_contender_hist_count *
            sum_of_contender_hist_count / sum_of_square_of_contender_hist_count
            )
        inference_hist_reference_value = sum_of_mult_of_both_hist_count / (
            sum_of_contender_hist_count * sum_of_inferenced_hist_count)
        score = contender_hist_reference_value * inference_hist_reference_value
    if score > 1.0:
        score = 1.0
    return score
