bdwproduct: Matrix - Weighted vector Multiplication with numerical or...

View source: R/RcppExports.R

bdwproductR Documentation

Matrix - Weighted vector Multiplication with numerical or DelayedArray data

Description

This function performs a weighted product of a matrix(X) with a weighted diagonal matrix (w)

Usage

bdwproduct(X, w, op)

Arguments

X

numerical or Delayed Array matrix

w

vector with weights

op

string indicating if operation 'XtwX' and 'XwXt' for weighted cross product (Matrix - Vector - Matrix) or 'Xw' and 'wX' for weighted product (Matrix - Vector)

Value

numerical matrix

Examples


n <- 100
p <- 60

X <- matrix(rnorm(n*p), nrow=n, ncol=p)

u <- runif(n)
w <- u * (1 - u)
ans <- bdwproduct(X, w,"xtwx")



BigDataStatMeth documentation built on March 30, 2022, 1:07 a.m.