aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGertjan van den Burg <gertjanvandenburg@gmail.com>2016-03-27 16:08:44 -0400
committerGertjan van den Burg <gertjanvandenburg@gmail.com>2016-03-27 16:08:44 -0400
commit7da06b81465eac6892561c10a64763dfb7d226e5 (patch)
treea308f7c5584ea7d1a8e25d70b5cce55d66c7bc66
parentexplain use.* are booleans (diff)
downloadsparsestep-7da06b81465eac6892561c10a64763dfb7d226e5.tar.gz
sparsestep-7da06b81465eac6892561c10a64763dfb7d226e5.zip
multiply normalize with sqrt(n) to remove dependence on n in normalization
-rw-r--r--R/preprocess.R1
1 files changed, 1 insertions, 0 deletions
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 {