コード例 #1
0
def kurtosis(iterable):
    mean = medida_central.mean(iterable)
    amount = len(iterable)
    sd = standard_deviation(iterable)
    total_sum = sum([((value - mean) / sd)**4 for value in iterable])
    return (((amount * (amount + 1)) /
             ((amount - 1) * (amount - 2) *
              (amount - 3))) * total_sum) - (3 * ((amount - 1)**2) /
                                             (amount - 2) * (amount - 3))
コード例 #2
0
def skewness(iterable):
    mean = medida_central.mean(iterable)
    amount = len(iterable)
    sd = standard_deviation(iterable)
    total_sum = sum([((value - mean) / sd)**3 for value in iterable])
    return (amount / ((amount - 1) * (amount - 2))) * total_sum
コード例 #3
0
def population_variance(iterable):
    mean = medida_central.mean(iterable)
    return sum([(value - mean)**2 for value in iterable]) / len(iterable)
コード例 #4
0
def coefficient_variation(iterable):
    return (standard_deviation(iterable) / medida_central.mean(iterable)) * 100
コード例 #5
0
def sample_variance(iterable):
    mean = medida_central.mean(iterable)
    return sum([(value - mean)**2 for value in iterable]) / (len(iterable) - 1)