WebMay 2, 2024 · What is covariance? If X and Y are two random variables with expected values, E (X) E(X) and E (Y) E(Y) respectively, their covariance is: \mathrm {Cov} (X,Y) \\ =E\left ( [X-E (X)] [Y-E (Y)]\right) Cov(X,Y)=E([X −E(X )][Y −E(Y )]) This covariance formula can further be simplified to: