Skip to content

Commit 8f356ff

Browse files
committed
rob fixed another type=full bug
1 parent ae37fdc commit 8f356ff

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

selectiveInference/R/funs.fixed.R

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ fixedLassoInf <- function(x, y, beta,
8282

8383
tol.coef = tol.beta * sqrt(n^2 / colSums(x^2))
8484
# print(tol.coef)
85-
# vars = which(abs(beta) > tol.coef)
86-
vars = abs(beta) > tol.coef
85+
vars = which(abs(beta) > tol.coef)
86+
# vars = abs(beta) > tol.coef
8787
# print(beta)
8888
# print(vars)
8989
if(sum(vars)==0){
@@ -97,8 +97,10 @@ fixedLassoInf <- function(x, y, beta,
9797
"'thresh' parameter, for a more accurate convergence."))
9898

9999
# Get lasso polyhedral region, of form Gy >= u
100-
if (type == 'full') out = fixedLassoPoly(x,y,lambda,beta,vars,inactive=TRUE)
101-
else out = fixedLassoPoly(x,y,lambda,beta,vars)
100+
logical.vars=rep(FALSE,p)
101+
logical.vars[vars]=TRUE
102+
if (type == 'full') out = fixedLassoPoly(x,y,lambda,beta,logical.vars,inactive=TRUE)
103+
else out = fixedLassoPoly(x,y,lambda,beta,logical.vars)
102104
A = out$A
103105
b = out$b
104106

@@ -128,8 +130,7 @@ fixedLassoInf <- function(x, y, beta,
128130
# add additional targets for inference if provided
129131
if (!is.null(add.targets)) vars = sort(unique(c(vars,add.targets,recursive=T)))
130132

131-
# k = length(vars)
132-
k=sum(vars)
133+
k = length(vars)
133134
pv = vlo = vup = numeric(k)
134135
vmat = matrix(0,k,n)
135136
ci = tailarea = matrix(0,k,2)

0 commit comments

Comments
 (0)