@@ -82,8 +82,8 @@ fixedLassoInf <- function(x, y, beta,
82
82
83
83
tol.coef = tol.beta * sqrt(n ^ 2 / colSums(x ^ 2 ))
84
84
# 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
87
87
# print(beta)
88
88
# print(vars)
89
89
if (sum(vars )== 0 ){
@@ -97,8 +97,10 @@ fixedLassoInf <- function(x, y, beta,
97
97
" 'thresh' parameter, for a more accurate convergence." ))
98
98
99
99
# 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 )
102
104
A = out $ A
103
105
b = out $ b
104
106
@@ -128,8 +130,7 @@ fixedLassoInf <- function(x, y, beta,
128
130
# add additional targets for inference if provided
129
131
if (! is.null(add.targets )) vars = sort(unique(c(vars ,add.targets ,recursive = T )))
130
132
131
- # k = length(vars)
132
- k = sum(vars )
133
+ k = length(vars )
133
134
pv = vlo = vup = numeric (k )
134
135
vmat = matrix (0 ,k ,n )
135
136
ci = tailarea = matrix (0 ,k ,2 )
0 commit comments