function m=weighted_mean(x,w)
%mean  of distribution with points x, weights w
% see also weighted_variance
m=sum(x.*w)/sum(w);