crossprod: Matrix Crossproduct

crossprodR Documentation

Matrix Crossproduct

Description

Matrix Crossproduct

Usage

## S4 method for signature 'AbstractFArray,AbstractFArray'
crossprod(x, y = NULL, weights = NULL, ...)

## S4 method for signature 'AbstractFArray,'NULL''
crossprod(x, y = NULL, weights = NULL, ...)

## S4 method for signature 'AbstractFArray,missing'
crossprod(x, y = NULL, weights = NULL, ...)

## S4 method for signature 'AbstractFArray,matrix'
crossprod(x, y = NULL, weights = NULL, ...)

Arguments

x

a farray or an R matrix

y

NULL or matrix

weights

numeric vector used as weight

...

passed to further methods

Value

Matrix of cross product

Examples


x <- matrix(1:100, 50)
crossprod(x)

fmat_x <- as.fmatrix(x)
crossprod(fmat_x)[]

weights <- (1:50)/50

t(x) %*% diag(weights) %*% x
crossprod(fmat_x, weights = weights)

## Not run: 

# large data set ~ 1.6GB
x <- as.fmatrix(matrix(rnorm(2e8), ncol = 2))

crossprod(x)

## End(Not run)



dipterix/farray documentation built on Oct. 16, 2022, 6:13 p.m.