conroylau / lpinfer

lpinfer: An R Package for Inference in Linear Programs
GNU General Public License v3.0
3 stars 5 forks source link

DKQS pvalue is not monotonicially increasing in tau #57

Closed a-torgovitsky closed 4 years ago

a-torgovitsky commented 4 years ago

By construction, the DKQS approach should reject more for lower values of tau. This is because the critical value minimization problem is made more slack by lower tau, so lower tau always leads to a smaller critical value.

I am not seeing this behavior, however:

set.seed(25)
r <- dkqs(data, lpm, .3, tau = c(.1, .25, .3), solver = "GUROBI")
print(r)

gives

  tau p-value
 0.10    0.49
 0.25    0.52
 0.30    0.47

I suspect this is because the bootstrap draws are being re-done for each value of tau. If that were not the case, then this should also give a p-value of .47, but it does not:

set.seed(25)
r <- dkqs(data, lpm, .3, tau = c(.3), solver = "GUROBI")
print(r)

gives

p-value: 0.49

The same bootstrap draws should be used for each value of tau so that this behavior does not happen.

a-torgovitsky commented 4 years ago

This is still using the same example debug.RData.zip :

conroylau commented 4 years ago

Done! I have fixed the bug here by using the same bootstrap data for different taus. It is now giving an (weakly) increasing taus in your example now. Thanks!