How to obtain covariance matrix eigenvalues from singular values?

2017-09-05 22:00:12

I would like to implement closed form of PPCA (Bishop, Tipping, 1999, Appendix A). In this paper they calculate $W$ in formula (15):


where $K_q$ is a matrix from eigenvalues $\lambda_i$ of covariance matrix as defined in formula (5).

On one hand I read here, that it is possible to calculate eigenvalues with

$\lambda_i = \frac{s_i^2}{n-1}$

Is it true, that principal values depend on number of samples $n$?

On other hand I found python implementation of closed PPCA on github, function __fit_ml, where it is written

mu = np.mean(self.y, 1)[:, np.newaxis]

[u, s, v] = np.linalg.svd(self.y - mu)



ss = s[:self.q]

ss = np.sqrt(np.maximum(0, ss**2 - self.prior_sigma))

w = u[:, :self.q].dot(np.diag(ss))

where author is apparently calculating with

$\lambda_i = s_i^2$

which is completely different.


Here $s_i$ is diagonal element of singular values matrix.