colSumsCrossprod: Apply crossprod and colSums

Description Usage Arguments Value Author(s) Examples

Description

Fast computation of crossprod(colSums(X),Y)

Usage

1
colSumsCrossprod(X, Y, transposeY)

Arguments

X

A matrix with dimensions k*n. Hence the result of colSums(X) has length n.

Y

A matrix with dimenions n*m. Can be a matrix with dimension m*n but then transposeY should be TRUE.

transposeY

Logical. If TRUE transpose Y before matrix multiplication.

Value

A vector of length m.

Author(s)

Thomas Alexander Gerds <tag@biostat.ku.dk>

Examples

1
2
3
4
5
6
7
x <- matrix(1:8,ncol=2)
y <- matrix(1:16,ncol=8)
colSumsCrossprod(x,y,0)

x <- matrix(1:8,ncol=2)
y <- matrix(1:16,ncol=2)
colSumsCrossprod(x,y,1)

bozenne/riskRegressionLight documentation built on May 7, 2019, 12:52 a.m.