def particle_mean(weights, locations):
        r"""
        Returns the arithmetic mean of the `locations` weighted by `weights`

        :param numpy.ndarray weights: Weights of each particle in array of
            shape ``(n_particles,)``.
        :param numpy.ndarray locations: Locations of each particle in array
            of shape ``(n_particles, n_modelparams)``
        :rtype: :class:`numpy.ndarray`, shape ``(n_modelparams,)``.
        :returns: An array containing the mean
        """
        return np.dot(weights, locations)