R/coinertiaI.R

"coinertiaI" <-
function(X, Y, fast = TRUE)
  {
    A <- t(X) %*% Y
    if (fast) {
      svdA <- La.svd(A, nu = 0)
      Psi <- Y %*% t(svdA$vt)
      return(Psi)
    } else {
      svdA <- La.svd(A)
      Ksi <- X %*% svdA$u
      Psi <- Y %*% t(svdA$vt)
      L <- diag(svdA$d)^2
      retval <- list(weights = list(X = svdA$u, Y = t(svdA$vt)),
                     scores = list(X = Ksi, Y = Psi),
                     lambda = L, call = match.call())
      class(retval) <- c("coinertiaI", "fitCoinertia")
      return(retval)
    }
  }

Try the cocorresp package in your browser

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

cocorresp documentation built on May 2, 2019, 5:16 p.m.