R/coinertiaI.R

Defines functions `coinertiaI`

`coinertiaI` <- function(X, Y, fast = TRUE) {
    A <- t(X) %*% Y
    retval <- if (fast) {
        svdA <- La.svd(A, nu = 0)
        Psi <- Y %*% t(svdA$vt)
    } 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")
    }
    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 7, 2021, 9:06 a.m.