The chkptstanr R package allows users to start/stop brms models with the function ‘chkpt_brms’. the function specifies that the model can handle multivariate formulas e.g. mvbrmsformulas - see: R: Checkpoint Sampling: brms
I can’t seem to get a multivariate model working though, receiving the error ‘formula must be of class formula or brmsformula’. See a reproducible example below. Any ideas what’s wrong?
library(chkptstanr)
library(brms)
path ← create_folder(folder_name = “chkpt_folder_m1”)
data_simple ← read.table(
“https://paul-buerkner.github.io/data/data_simple.txt”,
header = TRUE
)
head(data_simple)
model_simple ← bf(
mvbind(phen, cofactor) ~ 1 + (1|phylo),
family = gaussian()
)
fit_m1 ← chkpt_brms(
formula = model_simple,
data = data_simple,
path = “chkpt_folder_m1”,
iter_warmup = 1000,
iter_sampling = 1000,
iter_per_chkpt = 250,
)
R V4.2.3
chkptstanr V0.1.1
cmdtandr V0.7.1