def estimate(particles, weights):
    'returns mean and variance of the weighted particles'
    pos = particles
    mean = np.average(pos, weights=weights, axis=0)
    var = np.average(((pos - mean) ** 2), weights=weights, axis=0)
    return (mean, var)
returns mean and variance of the weighted particles
def estimate(particles, weights):
    
    pos = particles
    mean = np.average(pos, weights=weights, axis=0)
    var = np.average(((pos - mean) ** 2), weights=weights, axis=0)
    return (mean, var)