diagABA <- function(A, B){ D <- B D[lower.tri(D, diag=FALSE)] <- 0 D[upper.tri(D, diag=FALSE)] <- 2*D[upper.tri(D, diag=FALSE)] D <- (A%*%D)*A rowSums(D) }
Add the following code to your website.
REMOVE THIS Copy to clipboard
For more information on customizing the embed code, read Embedding Snippets.