check_rds_fits
checks brmsfit objects save as RDS files.
check_rds_fits(path = ".", fits = list.files(path = path, pattern = ".RDS$",
ignore.case = TRUE, full.names = TRUE), cores = 1, pb = TRUE, robust = TRUE,
html = FALSE, verbose = TRUE)
Directory in which to look for .rds files.
Name of the .rds files to be read. Optional. If supplied 'path' is igored. This behavior allows user to supply file names including directories.
Number of cores to use for parallelization. Default is 1 (no parallelization).
Logical to control if a progress bar is used. Default is TRUE.
Logical to control the type of central tendency measure as in summary.brmsfit
).
Logical to control whether results are returned in html format. Useful for creating Rmd or quarto html reports. Is FALSE (default) the table is return as a data frame object.
Logical to control if messages are printed into the console.
Returns a data frame with a summary of fitted models. Can be used to make sure all models were run with the same parameters (e.g. before combining models). If html = FALSE
the function will return a data frame, otherwise it will print the estimates in a table in html format. The summary includes: prior, formula, number of iterations, number of chain, thinning, warmup, number of parameters, number of divergent transitions, number of rhats higher than 1.05, tail and bulk effective sample sizes and seed.
The function reads all fits saved as rds files in the supplied directory and generates a table listing the parameters used to fit models.
Araya-Salas (2022), brmsish: miscellaneous functions to customize brms bayesian regression models. R package version 1.0.0.Paul-Christian Buerkner (2017). brms: An R Package for Bayesian Multilevel Models Using Stan. Journal of Statistical Software, 80(1), 1-28. doi:10.18637/jss.v080.i01
{
# create directory
dir.create(file.path(tempdir(), "rdss"))
# run 2 models
md1 <- brm(Petal.Length ~ Petal.Width + Species, iris, chains = 1,
iter = 500, file = file.path(tempdir(), "rdss", "md1"))
md2 <- brm(Petal.Length ~ Species, iris, chains = 1,
iter = 500, file = file.path(tempdir(), "rdss", "md2"))
# check fits
check_rds_fits(path = file.path(tempdir(), "rdss"))
}
#> Compiling Stan program...
#> Error in .fun(model_code = .x1): Boost not found; call install.packages('BH')