I am using PCA in MultivariateStats and trying to covert an old Matlab script to Julia. I am dealing with a serials of images. First I want to make sure I got the matrix right. I reshaped each image to a vector and put n images to a m x n
matrix. I think the format of this data is correct, same as Matlab. Then I generated a pca model by M = fit(PCA, data)
. Matlab would return [coeff,score,latent]
. I believe that M.prinvars
is latent
in Matlab and M.proj
is score
in Matlab. Using transform(M, data)
I will get the transpose of coeff
in Matlab. To reconstruct the images, I use score*coeff'
in Matlab. In Julia, I use reconstruct(M, coeff)
. Am I doing this right?