Defined weighted standard deviation function.