bdwproduct | R Documentation |
This function performs a weighted product of a matrix(X) with a weighted diagonal matrix (w)
bdwproduct(X, w, op)
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) |
numerical matrix
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.