Repository navigation
fix(bootstrap): cap how long one replicate may run - #34
Merged
Merged
Conversation
A perfectly separated resample can send the exact beta-Poisson optimiser searching for minutes, which held up the whole bootstrap indefinitely. Add replicate_time_limit (default 30 seconds, Inf for none) to the bootstrap and analysis functions. A replicate that overruns is recorded as not converged with the reason in its error column. The limit is passed to mirai workers with each batch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some exact beta-Poisson bootstrap resamples (for example every dose above a point responds and every dose below does not) send the optimiser searching for minutes, which stalled the whole run. This adds
replicate_time_limit(seconds, default 30,Inffor none) tobootstrap_dose_response(),bootstrap_dose_response_async(),bootstrap_dose_response_models()andanalyze_dose_response(). A replicate that overruns is recorded as not converged with the reason in itserrorcolumn. The limit travels to mirai workers with each batch.Measured on the Ward data, exact model, 200 replicates, seed 1, 8 workers: before, replicate 182 never finished; now the run finishes in 41 s with 194 converged and 1 timed out.
Notes for review:
setTimeLimit()already set in the process that runs the refit (R has no way to read and restore it); documented too.replicate_time_limitis the last parameter of every function it was added to, so positional callers are unaffected.