Skip to content

Commit 71c4da3

Browse files
wide matrices sufficient
1 parent e4b75f3 commit 71c4da3

File tree

1 file changed

+1
-44
lines changed

1 file changed

+1
-44
lines changed

selectiveInference/man/ROSI.Rd

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -127,49 +127,6 @@ library(selectiveInference)
127127
library(glmnet)
128128
set.seed(43)
129129

130-
n = 200
131-
p = 100
132-
s = 2
133-
sigma = 1
134-
135-
x = matrix(rnorm(n*p),n,p)
136-
x = scale(x,TRUE,TRUE)
137-
138-
beta = c(rep(10, s), rep(0,p-s)) / sqrt(n)
139-
y = x \%*\% beta + sigma*rnorm(n)
140-
141-
# first run glmnet
142-
gfit = glmnet(x,y,standardize=FALSE)
143-
144-
# extract coef for a given lambda; note the 1/n factor!
145-
# (and we don't save the intercept term)
146-
lambda = 4 * sqrt(n)
147-
lambda_glmnet = 4 / sqrt(n)
148-
beta = selectiveInference:::solve_problem_glmnet(x,
149-
y,
150-
lambda_glmnet,
151-
penalty_factor=rep(1,p),
152-
family="gaussian")
153-
# compute fixed lambda p-values and selection intervals
154-
out = ROSI(x,
155-
y,
156-
beta,
157-
lambda,
158-
dispersion=sigma^2)
159-
out
160-
161-
# an alternate approximate inverse from Boot and Nibbering
162-
163-
out = ROSI(x,
164-
y,
165-
beta,
166-
lambda,
167-
dispersion=sigma^2,
168-
debiasing_method="BN")
169-
out
170-
171-
# wide matrices work too
172-
173130
n = 100
174131
p = 200
175132
s = 2
@@ -201,7 +158,7 @@ out = ROSI(x,
201158
dispersion=sigma^2)
202159
out
203160

204-
# an alternate approximate inverse
161+
# an alternate approximate inverse from Boot and Nibbering
205162

206163
out = ROSI(x,
207164
y,

0 commit comments

Comments
 (0)