I’m having a super weird problem when trying to use adapt_delta
in a brms model. If I run the model without adapt_delta
, it converges. But if I add this parameter, I get an error message that says that there is a sampling problem:
SAMPLING FOR MODEL '8905f3b5c84488b617ca68a8e8087228' NOW (CHAIN 1).
[1] "Error in sampler$call_sampler(args_list[[i]]) : "
[2] " VECTOR_ELT() can only be applied to a 'list', not a 'externalptr'"
error occurred during calling the sampler; sampling not done
A reproducible example is below.
Has anyone experienced this sort of problem? According to the brms
documentation, the code for adapt_delta
is ok.
- Operating system: BigSur (M1 chip)
- brms 2.15.0
# Create dataframe.
(dat_long <- data.frame(
subj = rep(1:10, each = 100),
item = rep(1:10, each = 10),
cond = c(-.5,.5),
pTarget = rbinom(1000, 1, .6)
))
# Regular model (converges without issues)
m <- brm(formula = pTarget ~ cond,
iter = 1000,
family = bernoulli(),
chains = 1,
data = dat_long)
# Model with adapt_delta (gives weird error about the sampler)
m_with_delta <- brm(formula = pTarget ~ cond,
iter = 1000,
family = bernoulli(),
control = list(adapt_delta = 0.9),
chains = 1,
data = dat_long)
SAMPLING FOR MODEL '8905f3b5c84488b617ca68a8e8087228' NOW (CHAIN 1).
[1] "Error in sampler$call_sampler(args_list[[i]]) : "
[2] " VECTOR_ELT() can only be applied to a 'list', not a 'externalptr'"