def proposal(X, W, Centroids, bandwidth): d = np.zeros_like(X) for c in xrange(Centroids.shape[0]): d += norm(Centroids[c], bandwidth).pdf(X) * W[c] d /= np.sum(W) return d