Skip to content

Commit

Permalink
Fix normalization
Browse files Browse the repository at this point in the history
Multiply on the proper side =)
  • Loading branch information
eodus committed Feb 12, 2016
1 parent 5bf1053 commit 8d6bd30
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions R/ossa.R
Expand Up @@ -613,9 +613,16 @@ fossa.ssa <- function(x, nested.groups,
newV <- if (is.infinite(gamma)) fY else rbind(Y, gamma * fY)

dec <- eigen(crossprod(newV), symmetric = TRUE)
U <- U %*% dec$vectors
Z <- Z %*% dec$vectors
sigma <- rep(1, ncol(U))

if (normalize) {
U <- (U * rep(osigma, each = nrow(U))) %*% dec$vectors
Z <- V %*% dec$vectors
sigma <- rep(1, ncol(U))
} else {
U <- U %*% dec$vectors
Z <- Z %*% dec$vectors
sigma <- rep(1, ncol(U))
}

x <- clone(x, copy.cache = FALSE) # TODO Maybe preserve relevant part of cache?
.save.oblique.decomposition(x, sigma, U, Z, idx)
Expand Down

0 comments on commit 8d6bd30

Please sign in to comment.