Suppose I want to calculate a sample variance/covariance matrix:

cov(x) = $ \frac{\sum _{i=1} ^k (x_i - \overline{x})(x_i - \overline{x})^T}{k} $

I was wondering, if I calculate

$ \frac{\sum _i n_i(x_i - \overline{x})(x_i - \overline{x})^T}{k}$ , where n$_i>0$ are scalar

Would the resulting matrix still be positive semi definite?

Thank you for any insight on this.


1 Answer 1


Yes. Each $S_i = (x_i-\bar x)(x_i - \bar x)^T$ is a p.s.d. matrix, so any combination with non-negative weights will be p.s.d., as well.

To wit, consider, for an arbitrary compatible (same dimension) $a\in \mathbb{R}^p, p = {\rm dim}\, x$, the quadratic form $a^T S_i a$:

$$ a^T S_i a = a^T (x_i-\bar x)(x_i - \bar x)^T a = [a^T (x_i-\bar x)] \, [(x_i - \bar x)^T a] = [a^T (x_i-\bar x)]^2 \ge 0 $$

since the term in the square brackets is simply a scalar. The worst thing that can happen is that the vector $a$ is orthogonal to $x_i-\bar x$.

  • $\begingroup$ Is that because every vector times its transpose would lead to a p.s.d matrix? Is that always the case? I thought that just the overall sum $ \frac{\sum _{i=1} ^k (x_i - \overline{x})(x_i - \overline{x})^T}{k} $ was p.s.d. $\endgroup$
    – Laura
    Commented Aug 10, 2016 at 13:28
  • $\begingroup$ yes. I extended the answer to elaborate on this point. $\endgroup$
    – StasK
    Commented Aug 10, 2016 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.