Correlation Matrix
Shippingarray_correlationPearson correlation matrix of a data matrix whose columns are variables
Signature
Inputs
aMatrixrequired— A 2-D matrix; each COLUMN is a variable, each ROW an observation. Non-2-D input is rejected.
Outputs
correlationMatrix— Symmetric $k\times k$ Pearson correlation matrix ($k$ = number of columns); unit diagonal.
Description
Correlation Matrix takes a 2-D matrix whose columns are variables and rows are observations, and returns the symmetric Pearson correlation matrix , where is the linear correlation coefficient between column and column . The diagonal is all ones (each variable perfectly correlates with itself) and entries lie in .
Correlation is the covariance normalized by the product of standard deviations, so it is dimensionless and scale-invariant — multiplying a column by a constant leaves its correlations unchanged. This makes ideal for spotting linear dependence across heterogeneous variables (different units, different magnitudes). The node requires a rank-2 input and rejects vectors or tensors with a clear error. It is stateless.
Mathematics
Examples
Two perfectly correlated columns
A matrix with columns and (the second is twice the first) yields — the off-diagonal signals exact positive linear dependence regardless of the scale factor.
Applications
- Feature-correlation heatmaps for screening redundant variables before modelling.
- Detecting linearly-coupled sensor channels in a DAQ matrix.
- Sanity-checking that variables assumed independent are in fact uncorrelated.
Neat
Because correlation normalizes out scale, a column in volts and a column in millivolts of the same signal correlate at exactly $+1$ — the matrix is immune to unit choice.
The columns-are-variables convention matches pandas/NumPy `corrcoef(rowvar=False)`, so a matrix exported from a DataFrame drops straight in.