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
Aand applies ‘pod’.Viewing the
VectorArrayAas aA.dimxlen(A)matrix, the return values of this method are theVectorArrayof left singular vectors and aNumPy arrayof singular values of the singular value decomposition ofAcentered around the mean, where the inner product on R^(dim(A)) is given byproductand 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 ofAw.r.t. the left singular vectors and singular values, are returned.- Parameters:
- Returns:
principal_components –
VectorArrayof PCA coordinates.svals – One-dimensional
NumPy arrayof singular values.coeffs – If
return_reduced_coefficientsisTrue, aNumPy arrayof right singular vectors as conjugated rows.mean –
VectorArraycontaining the empirical mean of the inputA. The inputVectorArrayis centered by subtracting this mean before applying ‘pod’. To approximately reconstruct original snapshots add the mean back, e.g.:reconstructed = POD.lincomb(COEFFS) + mean