I'm trying to do PCA on historic forward rates. I'm using forward rates from the Bank of England going from Jan 2015 through end of May 2018. I calculate the differences in the rates from one day to the next and make a covariance matrix from these difference. The matrix is 51 x 51 (because the tenors are every 6 months to 25 years plus a 1 month tenor at the beginning). My matrix is not positive definite which is a problem for PCA. I don't understand why it wouldn't be. The data is "clean" (no gaps).
'Not positive definite' is an algebraic statement that some of the variables are linear combinations of one another. The problem then becomes one of tracking down the offending variates.
I've used two brute-force approaches for this but neither scales well in the presence of large amounts of information. One method is to examine pairwise correlations and partial correlations looking for very high r-values, e.g., r>=0.95. A second tactic is much more nitty-gritty and involves scrutinizing the variable-level scores across the resulting components as output from the PCA. By sorting the variables on their first few components one can identify variables with the same or highly similar score values.
I'm sure other QF participants have much more sophisticated tactics that do scale well to large data.
You have not shown data, so one can only guess.
If you have computed the covariance matrix from the full dataset with no missing values (and you have not used some weird estimator), then the only way to have negative eigenvalues is round-off error: in that case, those negative eigenvalues will be practically zero: so just replace them with zero. See http://comisef.wikidot.com/tutorial:repairingcorrelation.
A different question is whether your covariance matrix has full rank (i.e. is definite, not just semidefinite). If you have at least
n+1 observations, then the covariance matrix will inherit the rank of your original data matrix (mathematically, at least; numerically, the rank of the covariance matrix may be reduced because of round-off error). So you should check your original data matrix, whether it has rank 51, or less.