Skip to content

Commit 5b4bc08

Browse files
BF: estimate of sigma
1 parent ab91969 commit 5b4bc08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

selectiveInference/R/funs.randomized.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,8 @@ randomizedLassoInf = function(X,
307307
# if no sigma given, use OLS estimate
308308

309309
if (is.null(sigma)) {
310-
lm_y = lm(y ~ X[,E] - 1)
311-
sigma = sum(resid(lm_y)^2 / lm_y$df.resid)
310+
lm_y = lm(y ~ X_E - 1)
311+
sigma = sqrt(sum(resid(lm_y)^2) / lm_y$df.resid)
312312
}
313313
print(c(sigma, 'sigma'))
314314
target_cov = solve(t(X_E) %*% X_E)*sigma^2

0 commit comments

Comments
 (0)