This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

KarhunenLoeveDecomposition

KarhunenLoeveDecomposition
gives the Karhunen-Loeve transform of the numerical arrays and the transformation matrix m, returning the result in the form .
KarhunenLoeveDecomposition
uses the inverse of the matrix m for transforming the .
  • The inner product of m and gives .
  • The total variance of the is the same as the total variance of the .
  • The are given in order of decreasing variance.
  • The rows of the transformation matrix m returned by KarhunenLoeveDecomposition are the eigenvectors of the covariance matrix formed from the arrays .
  • KarhunenLoeveDecomposition effectively computes the inverse Karhunen-Loeve transformation. If the length of is less than the size of m, missing components are assumed to be zero.
Karhunen-Loeve decomposition of two datasets:
Principal component decomposition of RGB color channels:
Karhunen-Loeve decomposition of two datasets:
In[1]:=
Click for copyable input
Out[1]=
 
Principal component decomposition of RGB color channels:
In[1]:=
Click for copyable input
Out[1]=
Principal components of two grayscale images:
Karhunen-Loeve decomposition of three matrix-valued datasets:
Principal components of a list of color images:
Specify the transformation matrix:
Use a transformation matrix and lesser datasets:
Karhunen-Loeve decomposition with datasets shifted to mean zero:
Enhance the color contrast of an RGB image:
Reconstruct a multichannel image from 1, 2, or 3 components:
Transform a list of pictorial faces:
Show the residual images when using only the first three components:
The Karhunen-Loeve decomposition preserves the total variance:
Relation to PrincipalComponents:
A setting True is equivalent to subtracting the mean from the input data:
Normalizing by the square root of the number of datasets better preserves the input dynamics:
KarhunenLoeveDecomposition normally returns images with data type :
New in 8