R/self_test.R
self_test.Rd
Generate simulated data from fitted model and refit the model to the simulated data
self_test(
fit_RDS = NULL,
n = 10,
seeds = NULL,
which_seeds = NULL,
conditional = TRUE,
map_change = NULL,
do_parallel = TRUE,
n_cores = NULL,
res_dir = NULL,
wham_location = NULL,
test_dir = NULL,
save_inputs = FALSE
)
(required) location of RDS file with fitted WHAM model.
the number of simulated data sets to create and fit. Default = 10.
(optional) vector of seeds to use to generate each simulated data set.
(optional) which seeds
to use for simualted data set. Useful if doing self test in stages.
T/F whether to fix rather than simulate estimated random effects. Deafult = TRUE.
(optional) list of input$map elements for altering mapping assumptions of fitted model.
T/F whether to do self-test fits in parallel. Requires snowfall and parallel packages to be installed. Default = TRUE.
(optional) the number of cores to use for parallel fitting.
directory where to save individual files for each self test fit. Useful if doing self test in stages. If not provided, no files will be saved.
(optional) location of WHAM package. Useful if not using the WHAM installation in the standard library location.
(optional) directory for package repository. To be used when the function is being called during package testing rather than an installed version of WHAM.
T/F whether to save the simulated inputs in res_dir. Default = FALSE.
a list of two elements. First is the results which is a list (length = n) of lists with 6 elements: minimized negative log-likelihood, MLEs, gradient, SSB, F, abundance at age. Second element is the vector of seeds used for self-test simulations.