Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cross product

    Hi,

    I'm new to Mata and I'm still getting my feet wet, so apologies if this is a dumb question.

    I'm a little confused about some of the terminology, particularly with respect to the -cross- function.

    The manual states that this computes matrix multiplication of the form X'X.

    My question is this: Is this a common use of the term cross product? I've only learned cross product as the product of two vectors that produces a third, orthogonal vector (as in https://en.wikipedia.org/wiki/Cross_product). Is this just a terminology issue or is there something that I'm missing about how those two relate to one another? I've noticed similar uses of the term cross product in Cameron & Trivedi's Microeconometrics text.

    Thanks in advance.

  • #2
    The manual states that this computes matrix multiplication of the form X'X.
    The result of that computation is known in statistics as the matrix of sums of squares and cross-products of the data, or more tersely as the cross-products matrix. This is a different etymology than that for the cross-product of two vectors in linear algebra.

    If we think of the original matrix X as having k columns and n rows (k variables and n observations), and let Z = X'X, then Z will be a k-by-k matrix with Z[i,j] = X[i,1]X[j,1] + ... + X[i,n]X[j,n]. So the diagonal elements are the sums over all the observations of of the squares of the 1st, 2nd, ..., k-th variables, and the off-diagonal elements Z[i,j] are the sums over all the observations of the products of the i-th and j-th variables. The term "cross-product" means the product of two variables in a given observation, and those cross products are summed across the observations to form the cross-products matrix.

    Comment

    Working...
    X