runScnSet: Run the Bayesian population model for multiple parameter sets

View source: R/runScnSet.R

runScnSetR Documentation

Run the Bayesian population model for multiple parameter sets

Description

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

Usage

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.

See Also

Caribou demography functions: caribouBayesianPM(), caribouPopGrowth(), compositionBiasCorrection(), demographicCoefficients(), demographicProjectionApp(), demographicRates(), getOutputTables(), getPriors(), getScenarioDefaults(), getSimsNational(), plotRes(), popGrowthTableJohnsonECCC, simulateObservations()

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)

LandSciTech/caribouMetrics documentation built on Sept. 8, 2024, 8:09 p.m.