The matrices x and y will be interpreted as
collections of row vectors. They must have the same number of rows.
The entries of x and y may be
numeric, integer, logical or complex values.
The command sumouter computes the sum of the outer
products of corresponding row vectors, weighted by the entries of w:
$$
M = \sum_i w_i x_i^\top y_i
$$
where \(x_i\) is the i-th row of x
and \(y_i\) is the i-th row of y
(after removing any rows containing NA or other non-finite
values).
If w is missing or NULL, the weights will be taken as 1.
The result is a \(p \times q\) matrix where
p = ncol(x) and q = ncol(y).
The command quadform evaluates the quadratic form, defined by
the matrix v, for each of the row vectors of x:
$$
y_i = x_i V x_i^\top
$$
The result y is a numeric vector of length n where
n = nrow(x). If x[i,] contains NA or
other non-finite values, then y[i] = NA.
If v is missing or NULL,
it will be taken as the identity matrix, so
that the resulting values will be
$$
y_i = x_i x_i^\top
$$
The command bilinearform evaluates the more general bilinear
form defined by the matrix v. Here x and y must
be matrices of the same dimensions. For each row vector of
x and corresponding row vector of y, the bilinear form is
$$
z_i = x_i V y_i^\top
$$
The result z is a numeric vector of length n where
n = nrow(x). If x[i,] or y[i,] contains NA or
other non-finite values, then z[i] = NA.
If v is missing or NULL,
it will be taken as the identity matrix, so
that the resulting values will be
$$
z_i = x_i y_i^\top
$$