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)

Arguments

path

Directory in which to look for .rds files.

fits

Name of the .rds files to be read. Optional. If supplied 'path' is igored. This behavior allows user to supply file names including directories.

cores

Number of cores to use for parallelization. Default is 1 (no parallelization).

pb

Logical to control if a progress bar is used. Default is TRUE.

robust

Logical to control the type of central tendency measure as in summary.brmsfit).

html

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.

verbose

Logical to control if messages are printed into the console.

Value

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.

Details

The function reads all fits saved as rds files in the supplied directory and generates a table listing the parameters used to fit models.

References

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

Author

Marcelo Araya-Salas marcelo.araya@ucr.ac.cr)

Examples

{
# 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')