Perform Principal Component Analysis (PCA).
Variables in columns, observations in rows.
Number of components to return. If None, returns the as many as the smaller to the number of rows or columns of data.
Flag indicating to use standardized data with mean 0 and unit variance. standardized being True implies demean.
Flag indicating whether to demean data before computing principal components. demean is ignored if standardize is True.
- normalizebool ,
Indicates whether th normalize the factors to have unit inner product. If False, the loadings will have unit inner product.
Flag indicating to implement a two-step GLS estimator where in the first step principal components are used to estimate residuals, and then the inverse residual variance is used as a set of weights to estimate the final principal components
Series weights to use after transforming data according to standardize or demean when computing the principal components.
Determines the linear algebra routine uses. ‘eig’, the default, uses an eigenvalue decomposition. ‘svd’ uses a singular value decomposition.
Array (nobs, ncomp) of principal components (also known as scores).
Array (ncomp, nvar) of principal component loadings for constructing the factors.
Array (nobs, nvar) containing the projection of the data onto the ncomp estimated factors.
Array (ncomp,) where the element in the ith position is the R-square of including the fist i principal components. The values are calculated on the transformed data, not the original data.
Array (ncomp, 3) containing the Bai and Ng (2003) Information criteria. Each column is a different criteria, and each row represents the number of included factors.
Array of eigenvalues (nvar,).
Array of eigenvectors. (nvar, nvar).
This is a simple function wrapper around the PCA class. See PCA for more information and additional methods.