Reads a fitted model saved with bison_save(), so it can be used in a new R
session in the same way as a newly fitted model. Models saved with earlier versions of
bisonR (0.4.x), which kept the Stan fit in a separate file, are also read.
Arguments
- file
Path of an
.rdsfile written bybison_save()..rdsis appended if the file isn't found without it.
Examples
sim_data <- simulate_bison_model("binary", aggregated = TRUE)
fit_edge <- bison_model(
(event | effort) ~ dyad(node_1_id, node_2_id),
data = sim_data$df_sim,
model_type = "binary_conjugate",
priors = get_default_priors("binary_conjugate")
)
path <- tempfile(fileext = ".rds")
bison_save(fit_edge, path)
fit_reloaded <- bison_load(path)