R/rv.R

Defines functions rv

Documented in rv

rv <- function(y, x) {

  p <- dim(x)[2]
  sxy <- Rfast::cova( cbind(x, y) )[1:p, -(1:p)]
  sxx <- Rfast::cova(x)
  syy <- Rfast::cova(y)

  a <- sum( sxy^2 )
  b1 <- sum( sxx^2 )
  b2 <- sum( syy^2 )

  a / sqrt(b1 * b2)

}

Try the mvcor package in your browser

Any scripts or data that you put into this service are public.

mvcor documentation built on April 11, 2025, 5:39 p.m.