Get an object to fit a dose-selector that randomly selects doses. Whilst this design is unlikely to pass the ethical hurdles when investigating truly experimental treatments, this class is useful for illustrating methods and can be useful for benchmarking.

get_random_selector(
  parent_selector_factory = NULL,
  prob_select,
  supports_efficacy = FALSE,
  ...
)

Arguments

parent_selector_factory

optional object of type selector_factory that is in charge of dose selection before this class gets involved. Leave as NULL to just select random doses from the start.

prob_select

vector of probabilities, the probability of selecting dose 1...n

supports_efficacy

TRUE to monitor toxicity and efficacy outcomes; FALSE (by default) to just monitor toxicity outcomes.

...

Extra args are ignored.

Value

an object of type selector_factory.

Examples

prob_select = c(0.1, 0.3, 0.5, 0.07, 0.03)
model <- get_random_selector(prob_select = prob_select)
fit <- model %>% fit('1NTN')
fit %>% recommended_dose() # This is random
#> [1] 2
# We could also precede this selector with a set path:
model <- follow_path('1NN 2NN 3NN') %>%
  get_random_selector(prob_select = prob_select)
fit <- model %>% fit('1NN')
fit %>% recommended_dose() # This is not-random; it comes from the path.
#> [1] 2
fit <- model %>% fit('1NN 2NT')
fit %>% recommended_dose() # This is random; the path is discarded.
#> [1] 1