# covariance in 2 dimensional field

I want to know is the covariance equation which is shown below is how valid when we are in 2-dimensional fields (not 2-dimensional data)?

$$Cov(x,y)=\frac{\sum_{i=1}^{n}(x_i-\bar{x})(y_i-y)}{N-1}$$

for instance, suppose we want to find COV(x,y) given two elements of x and y:

x_samples={ [[1,2],[3,4]] , [[5,6],[7,8]] }

y_samples={ [[9,10],[11,12]] , [[13,14],[15,16]] }


can I use the above equation for this space?
This way unlike scaler space $$Cov(x,y)$$ is not equal to $$Cov(y,x)$$. is it true?

• Please tell us what you mean by "2-dimensional fields." Your bracket notation is not standard mathematical notation. – whuber Dec 28 '19 at 21:42
• suppose u have scaler numbers of x samples, {1,2}, and y samples, {3,4}, then you can compute COV(x,y) easily, but what if we have 2dimentional matrix instead of each sample ( 1, 2, 3, 4)? like the above samples I mentioned as an example. can we use same COV formula? – sakht Dec 30 '19 at 9:10
• Could you explain what this two-dimensional matrix represents? – whuber Dec 30 '19 at 14:32
• u can imagine that we have to class of images; x and y, and we have for each class 2 sample images, and each sample is a 2*2 matrix, like above, so I want to find covariance of these two classes. – sakht Jan 1 '20 at 8:54