compute_weighted_stats function

Compute mean and standard deviation