Takes the rema model output from fit_rema and returns OSA
residuals calculated using
TMB::oneStepPredict with accompanying
residual analysis plots. IMPORTANT: OSA residuals do not work for users
implementing the Tweedie distribution.
Usage
get_osa_residuals(
rema_model,
options = list(method = "fullGaussian", parallel = TRUE)
)Arguments
- rema_model
list out output from
fit_rema, which includes model results but also inputs. Of note to OSA residual calculations is therema_model$input$osaobject, which is a data.frame containing all the data or observations fit in the model that will have a residuals associated with them.- options
list of options for calculating OSA residuals, passed to
TMB::oneStepPredict. Default:options = list(method = "fullGaussian", parallel = TRUE). Alternative methods include "cdf", "oneStepGeneric", "oneStepGaussianOffMode", and "oneStepGaussian".
Value
a list of tidied data.frames containing the biomass and CPUE survey residuals with accompanying data, as well as a QQ-plot, histogram of residuals, and plots of residuals~year and residuals~fitted values by strata for the biomass and CPUE survey.
