Given matrices x and y as arguments and an optional matrix or vector of weights, w, return a weighted matrix cross-product, t(x) w y. If no weights are supplied, or the weights are constant, the function uses crossprod for speed.
wcrossprod(x, y, w)
Arguments
x,y: x, y numeric matrices; missing(y) is taken to be the same matrix as x. Vectors are promoted to single-column or single-row matrices, depending on the context.
w: A numeric vector or matrix of weights, conformable with x and y.
Returns
A numeric matrix, with appropriate dimnames taken from x and y.