gram: Function gram

Description Usage Arguments Value Author(s) References See Also Examples

Description

Function for calculating the (inner-product) Gram matrix that allows for block-matrix multiplication.

Usage

1
gram(X, trX, block = FALSE, block.size = 1000, show.progress = FALSE)

Arguments

X

a standardized feature matrix.

trX

(optional) the transpose matrix of X.

block

logical, block matrix computation is performed when TRUE, default option is FALSE.

block.size

used when block = TRUE. Default option is 1000, i.e. blocks of dimensionality 1000 x 1000.

show.progress

logical, when TRUE (and block = TRUE) the progress of the calculations is reported on the console.

Value

Returns the inner-product Gram matrix.

Author(s)

Konstanstinos Perrakis konstantinos.perrakis@dzne.de

Sach Mukherjee sach.mukherjee@dzne.de

References

Perrakis, K., Mukherjee, S. and the Alzheimers Disease Neuroimaging Initiative. (2018) Scalable Bayesian regression in high dimensions with multiple data sources. https://arxiv.org/pdf/1710.00596.pdf

See Also

gram.parallel

Examples

1
2
3
4
X <- matrix(rnorm(100 * 300), 100, 300)
G0 <- gram(X)                             # usual matrix multiplication
G1 <- gram(X, block=TRUE,block.size=100)  # block matrix multiplication
all.equal(G0, G1)

kperrakis/sbr documentation built on May 21, 2019, 10:48 a.m.