R/arv.R

Defines functions arv

Documented in arv

arv <- function(y, x) {

  px <- dim(x)[2]  ;    py <- dim(y)[2]
  s <- Rfast::cova( cbind(x, y) )
  sxy <- s[1:px, -(1:px)]
  up <- sum( sxy^2 )
  lx <- eigen(s[1:px, 1:px], symmetric = TRUE, only.values = TRUE)$values
  ly <- eigen(s[-(1:px), -(1:px)], symmetric = TRUE, only.values = TRUE)$values
  p <- min(px, py)
  up / sum( lx[1:p] * ly[1:p] )
}

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.