0

Suppose I want to say "everything is perfectly correlated" and I express that with a correlation matrix which is a block of 1's. Is that matrix positive definite? Matlab, for example, doesn't think so:

>> chol([1 1; 1 1])
Error using chol
Matrix must be positive definite.
  • No it will always have only one positive eigenvalue corresponding to an eigenvector full of ones. But as others have said it will be semi definite as all the other eigenvalues must be $0$. – mathreadler Jul 12 '17 at 20:08
  • This was actually a work problem and a colleague at work commented that the square matrix of all 1's is singular, so it has an infinite number of solutions when considered as a homogeneous system of linear equations, so is not positive definite. I don't see yet how having an infinite number of solutions implies not positive definite, but OK. The fun part though is that we figured out, if $U$ is an $n\times n$ square matrix of 1's, what a good "Cholesky" is: $n\times n$ matrix $V$ where the first column of $V$ is all 1's and the remaining columns are all 0's, so $U=V \times V^\top$. – Lars Ericson Jul 13 '17 at 02:51

3 Answers3

5

It is positive semidefinite but not positive definite. Somewhere the Cholesky routine is trying to divide by the square root of zero. Or trying to take the square root of a floating point number that should represent 0 but, because of FP round-off error, is slightly negative.

kimchi lover
  • 24,277
1

According to Wikipedia, a symmetric matrix is positive-definite if and only if all of its eigenvalues are positive. However, according to Wolfram Alpha, the eigenvalues of $\begin{bmatrix}1&1\\1&1\end{bmatrix}$ are $2$ (corresponding to the eigenvector $[1, 1]$) and $0$ (corresponding to $[-1, 1]$). Since one of the eigenvalues is $0$, the matrix is not positive-definite.

Tanner Swett
  • 10,624
  • 2
    You don’t need Wolfram Alpha to tell you that the matrix has zero as an eigenvalue. Its rank is clearly 1, so it has a non-trivial kernel. – amd Jul 12 '17 at 19:57
  • You don't need Wolfram Alpha to tell you that the matrix has $2$ as an eigenvalue. The sum of its raws is clearly $2$, so $2$ is an eigenvalue corresponding to $(1,1)$ – krirkrirk Jul 12 '17 at 21:33
0

Consider $\vec{x} = (1, -1)$, then $\vec{x}\mathbb{1}\vec{x}^t$ is zero although $\vec{x}$ is not the zerovector. Here $\mathbb{1}$ is your matrix with ones. Therefore this matrix is not positive definite.

Student
  • 4,438