In my Lazarus/Free Pascal application I generate a large multi-column numerical matrix. I want to run a Principal Component Analysis (PCA) on this table, but cannot seem to find any packages to do so.
The R language has a .dll library that exports the PCA function, but it returns an object of the class “princomp.” I am not sure how I would then go about extracting relevant information (such as the transformed matrix) from this class for use within Lazarus/FPC.
Take a look at ALGLIB:
http://en.wikipedia.org/wiki/ALGLIB
http://www.alglib.net/download.php
I think it has many numerical routines, among other singular value decomposition and eigenvalue decomposition. So if it does not have a special PCA routine, remember that the PCA mean vector is the mean of all the data vectors and that the PCA vectors are the eigenvectors of the covariance matrix and the corresponding eigenvalues are the variances of the projection of the data on those vectors.