From 7da06b81465eac6892561c10a64763dfb7d226e5 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Sun, 27 Mar 2016 16:08:44 -0400 Subject: multiply normalize with sqrt(n) to remove dependence on n in normalization --- R/preprocess.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/preprocess.R b/R/preprocess.R index f72c4f4..2ac28f0 100644 --- a/R/preprocess.R +++ b/R/preprocess.R @@ -18,6 +18,7 @@ preprocess <- function(x, y, normalize, intercept, XX, Xy, use.XX, use.Xy) if (normalize) { normx <- sqrt(drop(one %*% (x^2))) + normx <- sqrt(nobs) * normx names(normx) <- NULL x <- scale(x, FALSE, normx) } else { -- cgit v1.2.3