# sample variance of vector variable

I've been stuck on this problem for several days: In a sample of size $I$, each sample member $i=1,\ldots,I$, is described by some feature $m(i)$. Value $B$ is a certain function of $\mbox{avg}(m(i))$, that can be approximated by: $B=1/\mbox{avg}(m(i))$. Now I have to analyze the following expression: If $m(i)$ is a scalar, then this expression equals $B*\mbox{Var}(m(i))$, where $\mbox{Var}(\cdot)$ is a sample variance. But what if $m(i)$ is a $1 \times K$ row vector (which is a second case that I have to consider), and $B$ equals inverse of of diagonal matrix with $\mbox{avg}(m(j))$, for $j=1,\ldots,K$ on it's diagonal and zeros elswhere, i.e. $B$ is positive definite matrix, so there exists unique square root of $B$. But I don't see how to express it using variance of $m(i)$ or something of that sort.

What I hoped for was to express it as a quadratic form with some variance-covariance matrix associated to it, simmilar to standard expression for e.g. portfolio variance, just with other arguments. Or to manage to represent it as some quadratic form.

It would be more than appreciated if someone could actually help me with this!

1. $B$ is not necessary positive definite unless all averages are positive.

2. Your expression can be simplified:

$$\frac{1}{I}\sum_{i=1}^I \mu^i B {\mu^{i}}'- \bar\mu^i B {\bar\mu^{i}}'=\frac{1}{I}\sum_{i=1}^I \sum_{k=1}^K \frac{(\mu_k^i)^2}{\bar\mu_k} - \sum_{k=1}^K \bar\mu_k=$$ $$=\sum_{k=1}^K \frac{1}{\bar\mu_k} [\frac{1}{I}\sum_{i=1}^I (\mu_k^i)^2 - \bar\mu_k^2]=\sum_{k=1}^K \frac{Var(\mu_k^i)}{\bar\mu_k}=s'Bs$$ where $s=\sqrt{diag(Var(\mu^i))}: K \times 1$ vector of standard deviations.

However, this expression is undefined if any $\bar\mu_k=0$.

• Hm, wait but, SBS' has dimensions (KxK) right? And we started off from (1x1). And yes, all m(i) are positive, so B is PD. – dummy Apr 28 '14 at 0:57
• Oh. you're right. I edited my answer – d.k.o. Apr 28 '14 at 1:02
• But is that possible? To transform a scalar in a way that gives you a matrix? The whole expression is derivative of scalar w.r.t. some other scalar, so I'm not sure how would I interpret that the result is a matrix. Thnx a lot for your help! – dummy Apr 28 '14 at 1:02
• It's a scalar. I just used wrong notation. $Var(\mu^i)$ is a $K\times K$ covariance matrix. So, you extract it's diagonal... – d.k.o. Apr 28 '14 at 1:03
• Does this answer your question now? – d.k.o. Apr 28 '14 at 1:31