# NOT RUN {
if (interactive()) {
## Example from Braun2020
d1_maxn <- 5
cum_maxn <- 10
mod <- Crm$new(skeleton = c(0.03, 0.11, 0.25, 0.42, 0.58, 0.71),
scale = 0.85, # aka 'sigma'
target = 0.25)$
no_skip_esc(TRUE)$ # compare Braun's 'restrict = T'
no_skip_deesc(FALSE)$
stop_func(function(x) {
enrolled <- tabulate(x$level, nbins = length(x$prior))
x$stop <- enrolled[1] >= d1_maxn || max(enrolled) >= cum_maxn
x
})
mod$trace_paths(1, rep(2, 13), unroll = 4
, mc.cores = parallelly::availableCores(omit=2))
print(mod$performance)
plot_dutycycle(mod$performance)
}
# }
Run the code above in your browser using DataLab