Brms supporting expose_functions from models fit using cmdstanr backend?

Not sure how complicated this would be to implement (or if it actually is supported already and I’m missing something), but is it possible for brms to support the expose_functions(..., vectorize = TRUE) for models fit using a cmdstanr backend? Recognizing the underlying expose_stan_functions() appears to be rstan functionality.

Trying it anyway, I get: Error in if (model_code != "" && is.character(model_code)) { : missing value where TRUE/FALSE needed.

There should be a better error message, but unfortunately that’s not going to work with CmdStanR. In theory something like this should be possible but CmdStan isn’t set up for that. Maybe in the future though!

Good to know. Thank you!

I improved the error message to be more informative.

1 Like