PrincipalComponents[matrix]
transforms elements of matrix into unscaled principal components.
PrincipalComponents
PrincipalComponents[matrix]
transforms elements of matrix into unscaled principal components.
Details and Options
- PrincipalComponents gives the principal component transform of matrix.
- The principal components of matrix are linear transformations of the original columns into uncorrelated columns arranged in order of decreasing variance.
- PrincipalComponents supports a Method option. The following explicit settings can be specified:
-
"Covariance" uses covariance method (default) "Correlation" uses correlation method - If principal components of scaled columns (standardized principal components) are required, the option Method"Correlation" should be used.
- The dimensions of PrincipalComponents[matrix] are the same as the dimensions of matrix.
- If matrix consists of exact numbers or symbols, the result is also exact or symbolic, respectively.
Examples
open all close allBasic Examples (1)
Scope (3)
Principal components computed with arbitrary-precision numbers:
PrincipalComponents[{{1`20, 2`20}, {3`20, 5`20}, {5`20, 6`20}}]Principal components of exact numbers:
PrincipalComponents[{{1, 3}, {3, 5}, {4, 5}}]//SimplifyPrincipal components computation involving symbolic expressions:
PrincipalComponents[{{a, 1}, {2, a - 1}}]//FullSimplifyOptions (1)
Properties & Relations (2)
The principal component columns are ordered by decreasing variance:
data = {{13.2, 200, 58, 21.2}, {10, 263, 48, 44.5}, {8.1, 294, 80, 31}, {8.8, 190, 50, 19.5}, {9, 276, 91, 40.6}, {7.9, 204, 78, 38.7}, {3.3, 110, 77, 11.1}, {5.9, 238, 72, 15.8}, {15.4, 335, 80, 31.9}, {17.4, 211, 60, 25.8}};Variance[pc = PrincipalComponents[data]]The mean of each principal component column is zero:
Mean[pc] // ChopThe principal component columns are not correlated:
Correlation[pc]//ChopThe setting Method->"Correlation" yields the same results as standardizing the input matrix:
PrincipalComponents[{{1., 2., -1.}, {2., 3., 2.}, {4., 10., 9.}}, Method -> "Correlation"] == PrincipalComponents[Standardize[{{1., 2., -1.}, {2., 3., 2.}, {4., 10., 9.}}]]Possible Issues (1)
See Also
Eigenvectors Standardize KarhunenLoeveDecomposition SingularValueDecomposition SingularValueList DimensionReduce
Function Repository: MultidimensionalScaling
Related Guides
History
Text
Wolfram Research (2010), PrincipalComponents, Wolfram Language function, https://reference.wolfram.com/language/ref/PrincipalComponents.html.
CMS
Wolfram Language. 2010. "PrincipalComponents." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PrincipalComponents.html.
APA
Wolfram Language. (2010). PrincipalComponents. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PrincipalComponents.html
BibTeX
@misc{reference.wolfram_2026_principalcomponents, author="Wolfram Research", title="{PrincipalComponents}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/PrincipalComponents.html}", note=[Accessed: 15-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_principalcomponents, organization={Wolfram Research}, title={PrincipalComponents}, year={2010}, url={https://reference.wolfram.com/language/ref/PrincipalComponents.html}, note=[Accessed: 15-June-2026]}