Computes the matrix cross product.
CROSSPROD(A)
CROSSPROD(A, B)
A |
- |
A matrix. |
B |
- |
A matrix |
A matrix, the cross product.
W1: {{1, 3, 4},
{5, 7, 9},
{8, 9, 12}}
W2: {{1, 3, 2},
{2, 4, 5},
{1, 2, 0}}
crossprod(W1,W2) == {{19, 39, 27},
{26, 55, 41},
{34, 72, 53}}
W1' *^ W2 == {{19, 39, 27},
{26, 55, 41},
{34, 72, 53}}
(W2' *^ W1)' == {{19, 39, 27},
{26, 55, 41},
{34, 72, 53}}
W1: 1..10
W2: {sum(w1 * w1)}
W3: crossprod(w1)
W2 == W3 == 385, the sum of squares of the series in W1.
crossprod(a, b) is equivalent to
For complex matrices, the conjugate (Hermitian) transpose is computed, i.e
The matrix cross product is a common calculation when computing least squares curve fitting. See LINFIT for a least squares implementation that uses multiple calculation methods.
See DADiSP/MatrixXL to significantly optimize CROSSPROD.