def calc_percentage_nees_within_ci(nees, ci):
    """
    Calculates the percentage of NEES within the confidence interval
    """
    within_ci = [ind_nees < ci[1] and ind_nees > ci[0] for ind_nees in nees]
    return sum(within_ci) / len(nees)