this doesn't look right.
if the sum of weights is 1 and ddof and bias set to default values you always get a division by zero in the scaling due to fact = `N - ddof`