The second moment refers to the expected value of the square of a random variable.

Second Moment Matrix

The second moment matrix represents the pairwise relationships between different samples in a dataset. For a data matrix where each row is a sample, it is computed as:

For samples with features:

  • is an matrix
  • The resulting second moment matrix is
  • Entry represents the dot product between samples and , and the diagonal entries represent the second moment of each sample.
  • This is just the uncentered version of the covariance matrix.

Computing Sample-Sample Second Moment

Consider two samples:
Sample 1:
Sample 2:

The sample-sample second moment matrix is computed as: