, keepdim=0, normalize=0, demean=True)[source]

principal components with eigenvector decomposition similar to princomp in matlab


data : ndarray, 2d

data with observations by rows and variables in columns

keepdim : integer

number of eigenvectors to keep if keepdim is zero, then all eigenvectors are included

normalize : boolean

if true, then eigenvectors are normalized by sqrt of eigenvalues

demean : boolean

if true, then the column mean is subtracted from the data


xreduced : ndarray, 2d, (nobs, nvars)

projection of the data x on the kept eigenvectors

factors : ndarray, 2d, (nobs, nfactors)

factor matrix, given by, evecs)

evals : ndarray, 2d, (nobs, nfactors)


evecs : ndarray, 2d, (nobs, nfactors)

eigenvectors, normalized if normalize is true

See also

principal component analysis using svd