Simulate stratified-random survey

sim_survey(
sim,
n_sims = 1,
q = sim_logistic(),
trawl_dim = c(1.5, 0.02),
resample_cells = FALSE,
binom_error = TRUE,
min_sets = 2,
set_den = 2/1000,
lengths_cap = 500,
ages_cap = 10,
age_sampling = "stratified",
age_length_group = 1,
age_space_group = "division",
light = TRUE
)

## Arguments

sim Simulation from sim_distribution Number of surveys to simulate over the simulated population. Note: requesting a large number of simulations may max out your RAM. Use sim_survey_parallel if many simulations are required. Closure, such as sim_logistic, for simulating catchability at age (returned values must be between 0 and 1) Trawl width and distance (same units as grid) Allow resampling of sampling units (grid cells)? Setting to TRUE may introduce bias because depletion is imposed at the cell level. Impose binomial error? Setting to FALSE may introduce bias in stratified estimates at older ages because of more frequent rounding to zero. Minimum number of sets per strat Set density (number of sets per [grid unit] squared). WARNING: may return an error if set_den is high and resample_cells = FALSE because the number of sets allocated may exceed the number of cells in a strata. Maximum number of lengths measured per set If age_sampling = "stratified", this cap represents the maximum number of ages to sample per length group (defined using the age_length_group argument) per division or strat (defined using the age_space_group argument) per year. If age_sampling = "random", it is the maximum number of ages to sample from measured fish per set. Should age sampling be "stratified" (default) or "random"? Numeric value indicating the size of the length bins for stratified age sampling. Ignored if age_sampling = "random". Should age sampling occur at the "division" (default), "strat" or "set" spatial scale? That is, age sampling can be spread across each "division", "strat" or "set" in each year to a maximum number within each length bin (cap is defined using the age_cap argument). Ignored if age_sampling = "random". Drop some objects from the output to keep object size low?

## Value

A list including rounded population simulation, set locations and details and sampling details. Note that that N = "true" population, I = population available to the survey, n = number caught by survey.

## Examples

sim <- sim_abundance(ages = 1:10, years = 1:5) %>%
sim_distribution(grid = make_grid(res = c(10, 10))) %>%
sim_survey(n_sims = 5, q = sim_logistic(k = 2, x0 = 3))
plot_survey(sim, which_year = 2, which_sim = 1)