pymor.algorithms.pca

Module Contents

pymor.algorithms.pca.pca(A, product=None, modes=None, rtol=1e-07, atol=0.0, l2_err=0.0, method='method_of_snapshots', orth_tol=1e-10, return_reduced_coefficients=False)[source]

Principal component analysis (PCA) wrapper that centers A and applies ‘pod’.

Viewing the VectorArray A as a A.dim x len(A) matrix, the return values of this method are the VectorArray of left singular vectors and a NumPy array of singular values of the singular value decomposition of A centered around the mean, where the inner product on R^(dim(A)) is given by product and the inner product on R^(len(A)) is the Euclidean inner product. If desired, also the right singular vectors, which correspond to the reduced coefficients of A w.r.t. the left singular vectors and singular values, are returned.

Parameters:
  • A – See pod.

  • product – See pod.

  • modes – See pod.

  • rtol – See pod.

  • atol – See pod.

  • l2_err – See pod.

  • method – See pod.

  • orth_tol – See pod.

  • return_reduced_coefficients – See pod.

Returns:

  • principal_componentsVectorArray of PCA coordinates.

  • svals – One-dimensional NumPy array of singular values.

  • coeffs – If return_reduced_coefficients is True, a NumPy array of right singular vectors as conjugated rows.

  • meanVectorArray containing the empirical mean of the input A. The input VectorArray is centered by subtracting this mean before applying ‘pod’. To approximately reconstruct original snapshots add the mean back, e.g.: reconstructed = POD.lincomb(COEFFS) + mean