add global mean and variance