@@ -82,10 +82,11 @@ 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 )
85
+ # vars = which(abs(beta) > tol.coef)
86
+ vars = abs(beta ) > tol.coef
86
87
# print(beta)
87
88
# print(vars)
88
- if (length (vars )== 0 ){
89
+ if (sum (vars )== 0 ){
89
90
cat(" Empty model" ,fill = T )
90
91
return ()
91
92
}
@@ -96,10 +97,17 @@ fixedLassoInf <- function(x, y, beta,
96
97
" 'thresh' parameter, for a more accurate convergence." ))
97
98
98
99
# Get lasso polyhedral region, of form Gy >= u
100
+ <<<<<<< HEAD
101
+ if (type == ' full' ) out = fixedLasso.poly(x ,y ,beta ,lambda ,vars ,inactive = TRUE )
102
+ else out = fixedLasso.poly(x ,y ,beta ,lambda ,vars )
103
+ G = out $ G
104
+ u = out $ u
105
+ =======
99
106
if (type == ' full' & p > n ) out = fixedLassoPoly(x ,y ,lambda ,beta ,vars ,inactive = TRUE )
100
107
else out = fixedLassoPoly(x ,y ,lambda ,beta ,vars )
101
108
A = out $ A
102
109
b = out $ b
110
+ >>>>>>> 726b917649c7aaabd030b2cab062836ca774ef57
103
111
104
112
# Check polyhedral region
105
113
tol.poly = 0.01
@@ -127,7 +135,8 @@ fixedLassoInf <- function(x, y, beta,
127
135
# add additional targets for inference if provided
128
136
if (! is.null(add.targets )) vars = sort(unique(c(vars ,add.targets ,recursive = T )))
129
137
130
- k = length(vars )
138
+ k = length(vars )
139
+ k = sum(vars )
131
140
pv = vlo = vup = numeric (k )
132
141
vmat = matrix (0 ,k ,n )
133
142
ci = tailarea = matrix (0 ,k ,2 )
0 commit comments