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))
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
def population_variance(iterable): mean = medida_central.mean(iterable) return sum([(value - mean)**2 for value in iterable]) / len(iterable)
def coefficient_variation(iterable): return (standard_deviation(iterable) / medida_central.mean(iterable)) * 100
def sample_variance(iterable): mean = medida_central.mean(iterable) return sum([(value - mean)**2 for value in iterable]) / (len(iterable) - 1)