conroylau / lpinfer

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

Generalize subsample to allow for bootstrap and m out of n #52

Closed a-torgovitsky closed 4 years ago

a-torgovitsky commented 4 years ago

Add a new parameter called replace which has default FALSE, as in: https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/sample That should give the same behavior as we have currently.

This gives the user the following options:

conroylau commented 4 years ago

Done! I have updated the subsample command to incorporate the replace option. The README is also updated to reflect the update.

For the m out of n bootstrap, may I know that can phi be a number that is greater than 1, or should I restrict it to [0,1] as before? Thanks!

a-torgovitsky commented 4 years ago

m = n^\phi, so phi needs to be in (0, 1]

And if replace = FALSE, then of course phi = 1 is no good since it will just resample the same thing multiple times.

conroylau commented 4 years ago

Done! I have updated the code and README accordingly.

The code for subsample now checks the phi parameter depending on the parameter replace. If replace is FALSE, it has to be inside the interval (0, 1). Otherwise, it has to be inside the interval (0, 1].

Thanks!