WOLFRAM

gives the KarhunenLoeve transform {{b1,b2,},m} of the numerical arrays {a1,a2,}, where m.aibi.

uses the inverse of the matrix m for transforming bi to ai.

Details and Options

  • KarhunenLoeve decomposition is typically used to reduce the dimensionality of data and capture the most important variation in the first few components.
  • The ai can be arbitrary rank arrays or images of the same dimensions.
  • The inner product of m and {a1,a2,} gives {b1,b2,}.
  • In KarhunenLoeveDecomposition[{a1,}], rows of the transformation matrix m are the eigenvectors of the covariance matrix formed from the arrays ai.
  • The matrix m is a linear transformation of ai. The transformed arrays bi are uncorrelated, are given in order of decreasing variance, and have the same total variance as ai.
  • KarhunenLoeveDecomposition[{b1,b2,},m] effectively computes the inverse KarhunenLoeve transformation. If the length of {b1,b2,} is less than the size of m, missing components are assumed to be zero.
  • With an option setting StandardizedTrue, datasets ai are shifted so that their means are zero.

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

KarhunenLoeve decomposition of two datasets:

Out[3]=3

Principal component decomposition of RGB color channels:

Out[1]=1

Scope  (5)Survey of the scope of standard use cases

Principal components of two grayscale images:

Out[1]=1

KarhunenLoeve decomposition of three matrix-valued datasets:

Out[1]=1
Out[2]=2

Principal components of a list of color images:

Out[1]=1

Specify the transformation matrix:

Out[1]=1

Use a transformation matrix and lesser datasets:

Out[1]=1

Options  (1)Common values & functionality for each option

Standardized  (1)

KarhunenLoeve decomposition with datasets shifted to mean zero:

Out[1]=1

Applications  (3)Sample problems that can be solved with this function

Enhance the color contrast of an RGB image:

Out[2]=2

Reconstruct a multichannel image from 1, 2, or 3 components:

Out[1]=1

Transform a list of pictorial faces:

Out[1]=1

Show the residual images when using only the first three components:

Out[2]=2

Properties & Relations  (7)Properties of the function, and connections to other functions

The KarhunenLoeve decomposition preserves the total variance:

Out[1]=1
Out[2]=2

The KarhunenLoeve decomposition yields uncorrelated sets:

Out[2]=2

The KarhunenLoeve decomposition yields an orthogonal transformation matrix:

Out[2]=2

Relation to PrincipalComponents:

Out[1]=1
Out[2]=2

A setting Standardized->True is equivalent to subtracting the mean from the input data:

Out[1]=1
Out[2]=2

Normalizing by the square root of the number of datasets better preserves the input dynamics:

Out[1]=1

KarhunenLoeveDecomposition normally returns images of a real type:

Out[1]=1
Wolfram Research (2010), KarhunenLoeveDecomposition, Wolfram Language function, https://reference.wolfram.com/language/ref/KarhunenLoeveDecomposition.html (updated 2015).
Wolfram Research (2010), KarhunenLoeveDecomposition, Wolfram Language function, https://reference.wolfram.com/language/ref/KarhunenLoeveDecomposition.html (updated 2015).

Text

Wolfram Research (2010), KarhunenLoeveDecomposition, Wolfram Language function, https://reference.wolfram.com/language/ref/KarhunenLoeveDecomposition.html (updated 2015).

Wolfram Research (2010), KarhunenLoeveDecomposition, Wolfram Language function, https://reference.wolfram.com/language/ref/KarhunenLoeveDecomposition.html (updated 2015).

CMS

Wolfram Language. 2010. "KarhunenLoeveDecomposition." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/KarhunenLoeveDecomposition.html.

Wolfram Language. 2010. "KarhunenLoeveDecomposition." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/KarhunenLoeveDecomposition.html.

APA

Wolfram Language. (2010). KarhunenLoeveDecomposition. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/KarhunenLoeveDecomposition.html

Wolfram Language. (2010). KarhunenLoeveDecomposition. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/KarhunenLoeveDecomposition.html

BibTeX

@misc{reference.wolfram_2025_karhunenloevedecomposition, author="Wolfram Research", title="{KarhunenLoeveDecomposition}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/KarhunenLoeveDecomposition.html}", note=[Accessed: 13-May-2025 ]}

@misc{reference.wolfram_2025_karhunenloevedecomposition, author="Wolfram Research", title="{KarhunenLoeveDecomposition}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/KarhunenLoeveDecomposition.html}", note=[Accessed: 13-May-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_karhunenloevedecomposition, organization={Wolfram Research}, title={KarhunenLoeveDecomposition}, year={2015}, url={https://reference.wolfram.com/language/ref/KarhunenLoeveDecomposition.html}, note=[Accessed: 13-May-2025 ]}

@online{reference.wolfram_2025_karhunenloevedecomposition, organization={Wolfram Research}, title={KarhunenLoeveDecomposition}, year={2015}, url={https://reference.wolfram.com/language/ref/KarhunenLoeveDecomposition.html}, note=[Accessed: 13-May-2025 ]}