Algorithms_for_calculating_covariance