Suppose that w is the weight vector, and x is the data vector, with length N. The geometric mean is only available when each x[i] > 0. The geometric mean is gm = exp(sum(w[i]*log(x[i]))/W) where W = sum(w[i]). By default w[i] = 1 for all i, so in the unweighted case, W = N, and gm = exp(sum(log(x[i]))/N).