-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
enhancementNew feature or requestNew feature or request
Description
I have come across some cases where some individual models are taking a long time to fit, typically with highly divergent chains. It would be helpful to add a timeout option in [R/fit_bayesnec.R] at line 61 to allow the user to set a maximum limit for fitting any one model, such that the rest of the models are still fit. The withTimout function from R.utils seems like a good option, wrapped in try. Testing suggests this does still kill the models on any workers when multiple cores are used.
library(R.utils)
library(brms)
options(brms.backend = 'cmdstanr')
require(bayesnec)
data("nec_data")
tt <- try(withTimeout(
bnec(formula = y ~ crf(x, model = "nec3param"),
iter = 200000, warmup = 150, chains = 3, cores = 3,
seed = 10, data = nec_data),
timeout = 70, onTimeout = "error"))
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request