In [1]:
%load_ext rmagic
import numpy as np

Null model


In [2]:
reducedK = np.load('reduced_known0_4.0.npy')
reducedU = np.load('reduced_unknown0_4.0.npy')
covtest = np.load('covtest0_4.0.npy')
spacings = np.load('spacings0_4.0.npy')
hypotheses = np.load('hypotheses0_4.0.npy')

In [3]:
%%R -i reducedU,reducedK,covtest,spacings,hypotheses -h 800 -w 800
par(mfrow=c(3,3))
for (i in 1:9) {
   plot(ecdf(spacings[,i]), col='orange', main=paste('ECDF Step', i))
   plot(ecdf(reducedK[,i]), col='green', add=TRUE)
   plot(ecdf(covtest[,i]), col='red', add=TRUE)
   plot(ecdf(reducedU[,i]), col='blue', add=TRUE)
}


1-sparse


In [4]:
reducedK = np.load('reduced_known1_4.0.npy')
reducedU = np.load('reduced_unknown1_4.0.npy')
covtest = np.load('covtest1_4.0.npy')
spacings = np.load('spacings1_4.0.npy')
hypotheses = np.load('hypotheses1_4.0.npy')
first_null = []
for h in hypotheses:
    h_cumsum = h.cumsum()
    try:
        idx = min(np.nonzero(h_cumsum >= 1)[0]) + 1
    except ValueError:
        idx = hypotheses.shape[1] + 10
    first_null.append(idx)
first_null = np.array(first_null) + 1

Mixture


In [5]:
%%R -i reducedU,reducedK,covtest,spacings,first_null,hypotheses -h 800 -w 800
par(mfrow=c(3,3))
for (i in 1:9) {
   plot(ecdf(spacings[,i]), col='orange', main=paste('ECDF Step', i))
   plot(ecdf(reducedK[,i]), col='green', add=TRUE)
   plot(ecdf(covtest[,i]), col='red', add=TRUE)
   plot(ecdf(reducedU[,i]), col='blue', add=TRUE)
}


Null tests (after having found all variables)


In [6]:
%%R  -h 800 -w 800
par(mfrow=c(3,3))
for (i in 1:9) {
   null_Ps = (i >= first_null)
   if (sum(null_Ps) > 0) {
       plot(ecdf(spacings[null_Ps,i]), col='orange', main=paste('ECDF Step', i))
       plot(ecdf(reducedK[null_Ps,i]), col='green', add=TRUE)
       plot(ecdf(covtest[null_Ps,i]), col='red', add=TRUE)
       plot(ecdf(reducedU[null_Ps,i]), col='blue', add=TRUE)
   }
}


Rejections (steps where a true variable was discovered)


In [7]:
%%R  -h 800 -w 800
par(mfrow=c(3,3))
for (i in 1:9) {
   alt_Ps = (hypotheses[,i] == 1)
   if (sum(alt_Ps) > 0) {
       plot(ecdf(spacings[alt_Ps,i]), col='orange', main=paste('ECDF Step', i))
       plot(ecdf(reducedK[alt_Ps,i]), col='green', add=TRUE)
       plot(ecdf(covtest[alt_Ps,i]), col='red', add=TRUE)
       plot(ecdf(reducedU[alt_Ps,i]), col='blue', add=TRUE)
   }
}


2-sparse


In [8]:
reducedK = np.load('reduced_known2_4.0.npy')
reducedU = np.load('reduced_unknown2_4.0.npy')
covtest = np.load('covtest2_4.0.npy')
spacings = np.load('spacings2_4.0.npy')
hypotheses = np.load('hypotheses2_4.0.npy')
first_null = []
for h in hypotheses:
    h_cumsum = h.cumsum()
    try:
        idx = min(np.nonzero(h_cumsum >= 2)[0]) + 1
    except ValueError:
        idx = hypotheses.shape[1] + 10
    first_null.append(idx)
first_null = np.array(first_null) + 1

Mixture


In [9]:
%%R -i reducedU,reducedK,covtest,spacings,first_null,hypotheses -h 800 -w 800
par(mfrow=c(3,3))
for (i in 1:9) {
   plot(ecdf(spacings[,i]), col='orange', main=paste('ECDF Step', i))
   plot(ecdf(reducedK[,i]), col='green', add=TRUE)
   plot(ecdf(covtest[,i]), col='red', add=TRUE)
   plot(ecdf(reducedU[,i]), col='blue', add=TRUE)
}


Null tests (after having found all variables)


In [10]:
%%R  -h 800 -w 800
par(mfrow=c(3,3))
for (i in 1:9) {
   null_Ps = (i >= first_null)
   if (sum(null_Ps) > 0) {
       plot(ecdf(spacings[null_Ps,i]), col='orange', main=paste('ECDF Step', i))
       plot(ecdf(reducedK[null_Ps,i]), col='green', add=TRUE)
       plot(ecdf(covtest[null_Ps,i]), col='red', add=TRUE)
       plot(ecdf(reducedU[null_Ps,i]), col='blue', add=TRUE)
   }
}


Rejections (steps where a true variable was discovered)


In [11]:
%%R  -h 800 -w 800
par(mfrow=c(3,3))
for (i in 1:9) {
   alt_Ps = (hypotheses[,i] == 1)
   if (sum(alt_Ps) > 0) {
       plot(ecdf(spacings[alt_Ps,i]), col='orange', main=paste('ECDF Step', i))
       plot(ecdf(reducedK[alt_Ps,i]), col='green', add=TRUE)
       plot(ecdf(covtest[alt_Ps,i]), col='red', add=TRUE)
       plot(ecdf(reducedU[alt_Ps,i]), col='blue', add=TRUE)
   }
}


5-sparse


In [12]:
reducedK = np.load('reduced_known5_4.0.npy')
reducedU = np.load('reduced_unknown5_4.0.npy')
covtest = np.load('covtest5_4.0.npy')
spacings = np.load('spacings5_4.0.npy')
hypotheses = np.load('hypotheses5_4.0.npy')
first_null = []
for h in hypotheses:
    h_cumsum = h.cumsum()
    try:
        idx = min(np.nonzero(h_cumsum >= 5)[0]) + 1
    except ValueError:
        idx = hypotheses.shape[1] + 10
    first_null.append(idx)
first_null = np.array(first_null) + 1

In [13]:
%%R -i reducedU,reducedK,covtest,spacings,first_null,hypotheses -h 800 -w 800
par(mfrow=c(3,3))
for (i in 1:9) {
   plot(ecdf(spacings[,i]), col='orange', main=paste('ECDF Step', i))
   plot(ecdf(reducedK[,i]), col='green', add=TRUE)
   plot(ecdf(covtest[,i]), col='red', add=TRUE)
   plot(ecdf(reducedU[,i]), col='blue', add=TRUE)
}


Null tests (after having found all variables)


In [14]:
%%R  -h 800 -w 800
par(mfrow=c(2,2))
for (i in 1:9) {
   null_Ps = (i >= first_null)
   if (sum(null_Ps) > 0) {
       plot(ecdf(spacings[null_Ps,i]), col='orange', main=paste('ECDF Step', i))
       plot(ecdf(reducedK[null_Ps,i]), col='green', add=TRUE)
       plot(ecdf(covtest[null_Ps,i]), col='red', add=TRUE)
       plot(ecdf(reducedU[null_Ps,i]), col='blue', add=TRUE)
   }
}


Rejections (steps where a true variable was discovered)


In [15]:
%%R  -h 800 -w 800
par(mfrow=c(3,3))
for (i in 1:9) {
   alt_Ps = (hypotheses[,i] == 1)
   if (sum(alt_Ps) > 0) {
       plot(ecdf(spacings[alt_Ps,i]), col='orange', main=paste('ECDF Step', i))
       plot(ecdf(reducedK[alt_Ps,i]), col='green', add=TRUE)
       plot(ecdf(covtest[alt_Ps,i]), col='red', add=TRUE)
       plot(ecdf(reducedU[alt_Ps,i]), col='blue', add=TRUE)
   }
}



In [15]: