Updating formula for the sample covariance and correlation