Define scenarios in a table and simulateObservations(), run the caribouBayesianPM() model and getOutputTables() for each scenario.

runScnSet(
  scns,
  ePars,
  simNational,
  survAnalysisMethod = "KaplanMeier",
  getKSDists = TRUE,
  printProgress = FALSE,
  Niter = formals(caribouBayesianPM)$Niter,
  Nburn = formals(caribouBayesianPM)$Nburn
)

Arguments

scns

data.frame. Parameters for the simulations. See getScenarioDefaults() for details.

ePars

list. Additional parameters passed on to simulateObservations()

simNational

National simulation results, produced by calling getSimsNational()

survAnalysisMethod

Survival analysis method either "KaplanMeier" or "Exponential". The exponential method is only recommended when the number of collared animals (in survData) is small.

getKSDists

logical. Should Kolmogorov–Smirnov distances be calculated?

printProgress

logical. Should the scenario number and parameters be printed at each step?

Niter

Number of iterations for the MCMC algorithm.

Nburn

Length of burn-in for the MCMC algorithm.

Value

A list similar to getOutputTables() where tables for each scenario have been appended together. Plus an error log for any scenarios that failed to run.

Examples

scns <- expand.grid(
  obsYears =c(10, 20), collarCount = c(30, 300), cowMult = 2, collarInterval = 2,
  assessmentYrs = 1, iAnthro = 0,
  obsAnthroSlope = 0, projAnthroSlope = 0, sQuantile = 0.9,
  rQuantile = 0.7, N0 = 1000
)

eParsIn <- list(collarOnTime = 1, collarOffTime = 12, collarNumYears = 3)
scResults <- runScnSet(scns, eParsIn, getSimsNational(), getKSDists = FALSE,
                       # only set to speed up example. Normally keep defaults.
                       Niter = 10, Nburn = 2)
#> Warning: warning, low sample size of adult females in at least one year
#> using Kaplan-Meier survival model
#> Using saved object
#> Warning: missing years of survival data.Start model at beginning of consecutive years. Years of survival data:  c(2004, 2005, 2006, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023)
#> Warning: warning, low sample size of adult females in at least one year
#> using Kaplan-Meier survival model
#> using Kaplan-Meier survival model
#> using Kaplan-Meier survival model