Skip to content

Commit 2439d73

Browse files
check that solution is same as old code -- currently failing
1 parent 2c0e3d6 commit 2439d73

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/test_debiasing.R

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
library(selectiveInference)
2+
source('oldcode.R')
3+
4+
n = 500; p = 50
5+
6+
X = matrix(rnorm(n * p), n, p)
7+
S = t(X) %*% X / n
8+
9+
mu = 7.791408e-02
10+
11+
A1 = debiasingMatrix(S, FALSE, n, 1:5, mu=mu, max_iter=1000)
12+
A2 = debiasingMatrix(S / n, FALSE, n, 1:5, mu=mu, max_iter=1000)
13+
14+
B1 = debiasingMatrix(X, TRUE, n, 1:5, mu=mu, max_iter=1000)
15+
B2 = debiasingMatrix(X / sqrt(n), TRUE, n, 1:5, mu=mu, max_iter=1000)
16+
17+
C1 = InverseLinfty(S, n, mu=mu, maxiter=1000)[1:5,]
18+
C2 = InverseLinfty(S / n, n, mu=mu, maxiter=1000)[1:5,]
19+
20+
par(mfrow=c(2,3))
21+
plot(A1[1,], C1[1,])
22+
plot(A1[1,], B1[1,])
23+
plot(B1[1,], C1[1,])
24+
25+
plot(A1[1,], A2[1,])
26+
plot(B1[1,], B2[1,])
27+
plot(C1[1,], C2[1,])

0 commit comments

Comments
 (0)