The question is written in title.
I read a theorem saying:
Suppose $A\in \mathbb R^{n\times n}$ is symmetric. Then the following are equivalent.
- $A$ is positive semidefinite.
- Eigenvalues of $A$ are all non-negative.
- $A$ can be factored as $A=G^TG$ where $G$ is an $p\times n$ matrix for some $p$.
The reason why I am asking is that I have a matrix $X$ and get some negative eigenvalues of $X^TX$ using either MatLab or R.