This is the definition of a covariance matrix. http://en.wikipedia.org/wiki/Covariance_matrix#Definition
Each element in the matrix, except in the principal diagonal, (if I am not wrong) simplifies to E(x_{i} * x_{j}) - mean(i)*mean(j) where i and j are the row number and column number of the covariance matrix.
From the numpy documentation,
x = np.array([[0, 2], [1, 1], [2, 0]]).T
x
array([[0, 1, 2], [2, 1, 0]])
np.cov(x)
array([[ 1., -1.],
[-1., 1.]])
The first row i.e [0, 1, 2] corresponds to X_{0} and the second row i.e [2, 1, 0] corresponds to X_{1} How is expectation of X_{0}*X_{1} calculated, since the distributions of the random variables are not knowno?
Thanks.
See Question&Answers more detail:os