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.


open allclose all

Basic Examples  (1)

Principal components of two datasets, treated as the columns of a matrix:

Scope  (3)

Principal components computed with arbitrary-precision numbers:

Principal components of exact numbers:

Principal components computation involving symbolic expressions:

Options  (1)

Method  (1)

Principal components using correlation scaling:

Properties & Relations  (2)

The principal component columns are ordered by decreasing variance:

The mean of each principal component column is zero:

The principal component columns are not correlated:

The setting Method->"Correlation" yields the same results as standardizing the input matrix:

Possible Issues  (1)

For certain symbolic matrices the result may be very large:

Neat Examples  (1)

Align the principal axis of a two-dimensional shape with the horizontal axis:

Wolfram Research (2010), PrincipalComponents, Wolfram Language function,


Wolfram Research (2010), PrincipalComponents, Wolfram Language function,


Wolfram Language. 2010. "PrincipalComponents." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2010). PrincipalComponents. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2024_principalcomponents, author="Wolfram Research", title="{PrincipalComponents}", year="2010", howpublished="\url{}", note=[Accessed: 18-July-2024 ]}


@online{reference.wolfram_2024_principalcomponents, organization={Wolfram Research}, title={PrincipalComponents}, year={2010}, url={}, note=[Accessed: 18-July-2024 ]}