
Share of variance explained by the first principal component
Source:R/size_shape.R
pc1_variance_share.RdDiagnostic for the size and shape reparametrization: when a single component dominates, the traits are mostly one size gradient plus noise, and fitting size and shape scores is a much better behaved model than fitting all of the raw traits.
Arguments
- Y
Numeric matrix of traits, individuals in rows.
NAis allowed and is not discarded: the correlations are estimated from the available values, as described insize_shape.
Value
The share of the total variance taken by the first principal
component of the correlation matrix of Y, between 1 / ncol(Y)
and 1 (1 for a single trait).
Details
The correlation matrix is used so that traits measured on different
scales do not dominate through their units alone. A share near one means
the traits are one gradient, which is what size_shape is for;
a share close to 1 / ncol(Y) means the traits carry independent
information and no reparametrization is needed.