# Scalar generalization of variance for multi-dimensionnal random variables

I am wondering how to define a scalar generalization of variance for multi-dimensionnal random variables. In the case of simple multi-dimensionnal spaces where all dimensions have a similar behaviour, like 3D space or RGB color space, it makes sense to define it as this question suggests : $D(X)=E((X-E(X))^T(X-E(X)))$

One of the answers claims that $D(X)$ is then equal to the sum of the variances of each component. Is this true, and if yes, is there a simple demonstration for that ?

Assuming that $E(X)=0$, I tried to approach this problem from the integral point of view : $\int_X \frac{<X|X>}{(2\pi)^{n/2}|\Sigma|^{1/2}}\exp(-\frac{1}{2}X^T \Sigma^{-1} X) dX$ where n is the dimension of X and $\Sigma$ is the covariance matrix. Considering a diagonalisation of $\Sigma$ and a change of variables might allow to simplify the integral. Then, however, I am not sure how to deal with the $<X|X>$ term and moreover, it seems to lead towards the product of dimension variances, not the sum ...

Any ideas ?

-

If $X=(X_1,\ldots,X_n)^T$ is a $n$-dimensional random variable, then $$E[X]=(E[X_1],\ldots,E[X_n])^T=(\mu_1,\ldots,\mu_n)$$ is the vector of means. Hence $$(X-E[X])^T(X-E[X])= \begin{bmatrix} X_1-\mu_1 &\cdots &X_n-\mu_n \end{bmatrix} \begin{bmatrix} X_1-\mu_1\\ \vdots\\ X_n-\mu_n \end{bmatrix} =\sum_{i=1}^n(X_i-\mu_i)^2$$ or in other words, it is just the scalar product of the vector $X-E[X]$ with itself (or the square of its norm). Using the linearity of expectation we obtain $$E[(X-E[X])^T(X-E[X])]=\sum_{i=1}^n E[(X_i-\mu_i)^2]=\sum_{i=1}^n\mathrm{Var}(X_i).$$