Consider the data X = (58,59,63,60,60,63,60,57,58,59). An unbiased estimation for population variance would be
arr = [58, 59, 63, 60, 60, 63, 60, 57, 58, 59]
n = 10
avg = 0
variance = 0
for i in range(n):
avg += arr[i]
avg = avg / n
for i in range(n):
variance += ((arr[i] - avg) ** 2)
variance = variance / (n - 1)
print(variance)
Comments
Leave a comment