FUNCTION REFERENCE

pca

Principal components of observations stored in rows.

Principal components of observations stored in rows.

Syntax

[coeff,score,latent,tsquared,explained,mu] = pca(X,'NumComponents',q)

Centered and Economy default true. Algorithm is 'svd' (default) or 'eig'. Rows defaults to 'complete': NaN rows are omitted and restored as NaN scores and T-squared. Rows='all' rejects NaNs. Rows='pairwise' is not supported yet. Positive Weights and positive VariableWeights or 'variance' are accepted. VariableWeights scale the coefficient metric; score uses those weights. The largest-magnitude entry of each coefficient column is positive (first entry wins ties). NumComponents truncates coefficients and scores; T-squared uses the full nonzero component space. latent and explained retain the economy-size spectrum; explained is percentage variance.

Example

[c,s,l] = pca([1 2;2 4;3 6],'NumComponents',1);   % latent(1) = 5

Differences from MATLAB: Real two-dimensional data only; pairwise covariance and ALS are not supported yet. Observation weights must be strictly positive. Weighted sample covariance uses reliability-weight normalization, which differs from Octave's raw-weight scaling.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.