diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2016-03-27 16:08:44 -0400 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2016-03-27 16:08:44 -0400 |
| commit | 7da06b81465eac6892561c10a64763dfb7d226e5 (patch) | |
| tree | a308f7c5584ea7d1a8e25d70b5cce55d66c7bc66 | |
| parent | explain use.* are booleans (diff) | |
| download | sparsestep-7da06b81465eac6892561c10a64763dfb7d226e5.tar.gz sparsestep-7da06b81465eac6892561c10a64763dfb7d226e5.zip | |
multiply normalize with sqrt(n) to remove dependence on n in normalization
| -rw-r--r-- | R/preprocess.R | 1 |
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 { |
