Update a spOccupancy or spAbundance model run with more MCMC iterations
Update a spOccupancy or spAbundance model run with more MCMC iterations
Function for updating a previously run spOccupancy or spAbundance model with additional MCMC iterations. This function is useful for situations where a model is run for a long time but convergence/adequate mixing of the MCMC chains is not reached. Instead of re-running the entire model again, this function allows you to pick up where you left off. This function is currently in development, and only currently works with the following spOccupancy and spAbundance model objects: msAbund, sfJSDM, lfJSDM. Note that cross-validation is not possible when updating the model.
object: a spOccupancy or spAbundance model object. Currently supports objects of class msAbund and sfJSDM.
n.batch: the number of additional MCMC batches in each chain to run for the adaptive MCMC sampler. Only valid for model types fit with an adaptive MCMC sampler
n.samples: the number of posterior samples to collect in each chain. Only valid for model types that are run with a fully Gibbs sampler and have n.samples as an argument in the original model fitting function.
n.burn: the number of samples out of the total n.batch * batchlength to discard as burn-in for each chain from the updated samples. Note this argument does not discard samples from the previous model run, and rather only applies to the samples in the updated run of the model. Defaults to 0
n.thin: the thinning interval for collection of MCMC samples in the updated model run. The thinning occurs after the n.burn
samples are discarded. Default value is set to 1.
keep.orig: A logical value indicating whether or not the samples from the original run of the model should be kept or discarded.
verbose: if TRUE, messages about data preparation, model specification, and progress of the sampler are printed to the screen. Otherwise, no messages are printed.
n.report: the interval to report Metropolis sampler acceptance and MCMC progress.
save.fitted: logical value indicating whether or not fitted values and likelihood values should be saved in the resulting model object. This is only relevant for models of class msAbund. If save.fitted = FALSE, the components y.rep.samples, mu.samples, and like.samples
will not be included in the model object, and subsequent functions for calculating WAIC, fitted values, and posterior predictive checks will not work, although they all can be calculated manually if desired. Setting save.fitted = FALSE can be useful when working with very large data sets to minimize the amount of RAM needed when fitting and storing the model object in memory.
An object of the same class as the original model fit provided in the argument object. See the manual page for the original model type for complete details.