how is a covariance calculated 
for a set of data points with two variables the covariance is measured by taking the difference between each variable and their respective means these differences are then multiplied and averaged across all of the data points in mathematical notation this is expressed as covariance returnabc averageabc returnxyz averagexyz sample size 1 the bottom linecovariance is an important statistical metric for comparing the relationships between multiple variables in investing covariance is used to identify assets that can help diversify a portfolio 