Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Covariance
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Discrete random variables=== If the (real) random variable pair <math>(X,Y)</math> can take on the values <math>(x_i,y_i)</math> for <math>i = 1,\ldots,n</math>, with equal probabilities <math>p_i=1/n</math>, then the covariance can be equivalently written in terms of the means <math>\operatorname{E}[X]</math> and <math>\operatorname{E}[Y]</math> as <math display="block">\operatorname{cov} (X,Y) = \frac{1}{n}\sum_{i=1}^n (x_i-E(X)) (y_i-E(Y)).</math> It can also be equivalently expressed, without directly referring to the means, as<ref>{{cite conference |author=Yuli Zhang |author2=Huaiyu Wu |author3=Lei Cheng |title=Some new deformation formulas about variance and covariance|book-title=Proceedings of 4th International Conference on Modelling, Identification and Control(ICMIC2012)|date=June 2012 |pages=987β992}}</ref> <math display="block"> \operatorname{cov}(X,Y) = \frac{1}{n^2} \sum_{i=1}^n \sum_{j=1}^n \frac{1}{2}(x_i - x_j)(y_i - y_j) = \frac{1}{n^2} \sum_i \sum_{j>i} (x_i-x_j)(y_i - y_j). </math> More generally, if there are <math>n</math> possible realizations of <math>(X,Y)</math>, namely <math>(x_i,y_i)</math> but with possibly unequal probabilities <math>p_i </math> for <math>i = 1,\ldots,n</math>, then the covariance is <math display="block">\operatorname{cov} (X,Y) = \sum_{i=1}^n p_i (x_i-E(X)) (y_i-E(Y)).</math> In the case where two discrete random variables <math>X</math> and <math>Y</math> have a joint probability distribution, represented by elements <math>p_{i,j}</math> corresponding to the joint probabilities of <math>P( X = x_i, Y = y_j )</math>, the covariance is calculated using a double summation over the indices of the matrix: <math display="block">\operatorname{cov} (X, Y) = \sum_{i=1}^{n}\sum_{j=1}^{n} p_{i,j} (x_i - E[X])(y_j - E[Y]).</math>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)