simulateObservations: Simulate observations

View source: R/simulateObservations.R

simulateObservationsR Documentation

Simulate observations

Description

First, a example population trajectory is simulated from the national model and a disturbance scenario. Parameters specify a monitoring program that is applied to simulate observations from the example trajectory. Parameters for the caribou monitoring program, disturbance scenario and the true population trajectory can be specified with getScenarioDefaults().

Usage

simulateObservations(
  paramTable,
  cowCounts = NULL,
  freqStartsByYear = NULL,
  printPlot = FALSE,
  collarNumYears = 4,
  collarOffTime = 5,
  collarOnTime = 8,
  distScen = NULL,
  populationGrowthTable = caribouMetrics::popGrowthTableJohnsonECCC,
  survivalModelNumber = "M1",
  recruitmentModelNumber = "M4",
  writeFilesDir = NULL
)

Arguments

paramTable

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

cowCounts

data.frame. Optional. Number of cows counted in aerial surveys each year. If NULL, and paramTable contains cowMult the number of cows that survive calving based on the collar data is multiplied by cowMult to determine the number of cows counted in aerial surveys. If paramTable does not contain cowMult paramTable$cowCount is used to set the number of cows counted in aerial surveys each year. If a data.frame is provided it must have 3 columns "Year", "Count", and "Class" where class is "cow" in all rows.

freqStartsByYear

data.frame. Optional. Number of collars deployed in each year. If NULL paramTable$collarCount is used as the target number of collars and each year that collars are deployed they will be topped up to this number. If a data.frame is provided it must have 2 columns "Year" and "numStarts" and the "numStarts" is the absolute number of collars deployed in that year.

printPlot

logical. print a plot of the true population trajectory?

collarNumYears

integer. Number of years until collar falls off

collarOffTime

integer. Month that collars fall off. A number from 1 (January) to 12 (December)

collarOnTime

integer. Month that collars are deployed. A number from 1 (January) to 12 (December)

distScen

data.frame. Disturbance scenario. Must have columns "Year", "Anthro", and "fire_excl_anthro" containing the year, percentage of the landscape covered by anthropogenic disturbance buffered by 500 m, and the percentage covered by fire that does not overlap anthropogenic disturbance. See disturbanceMetrics(). If NULL the disturbance scenario is simulated based on paramTable

populationGrowthTable

data.frame.popGrowthTableJohnsonECCC is included in the package and should be used in most cases. A custom table of model coefficients and standard errors or confidence intervals can be provided but it must match the column names of popGrowthTableJohnsonECCC. If the table does not contain the standard error it is calculated from the confidence interval.

survivalModelNumber, recruitmentModelNumber

character. Which model number to use see popGrowthTableJohnsonECCC for options.

writeFilesDir

characater. If not NULL simSurvObs and ageRatioOut results will be saved to csv files in the directory provided

Details

For a detailed description of the process for simulating data see the vignette (vignette("BayesianDemographicProjection", package = "caribouMetrics")).

Value

a list with elements:

  • minYr: first year in the simulations,

  • maxYr: last year in the simulations,

  • simDisturbance: a data frame with columns Anthro, fire_excl_anthro, Total_dist, and Year,

  • simSurvObs: a data frame of survival data with columns id, Year, event, enter, and exit,

  • ageRatioOut: a data frame of calf cow counts for each year with columns Year, Count, and Class,

  • exData: a tibble of expected population metrics based on the national model,

  • paramTable: a data frame recording the input parameters for the simulation.

See Also

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

Examples

scns <- getScenarioDefaults(projYears = 10, obsYears = 10,
                            obsAnthroSlope = 1, projAnthroSlope = 5,
                            collarCount = 20, cowMult = 5)

simO <- simulateObservations(scns)

LandSciTech/caribouMetrics documentation built on Feb. 3, 2024, 9:41 p.m.