Skip to contents

Produces summary tables for Bayesian caribou population model results.

Usage

getOutputTables(
  caribouBayesDemogMod,
  startYear = min(caribouBayesDemogMod$inData$disturbanceIn$Year),
  endYear = max(caribouBayesDemogMod$inData$disturbanceIn$Year),
  paramTable = data.frame(param = "observed"),
  exData = NULL,
  simInitial = NULL
)

Arguments

caribouBayesDemogMod

caribou Bayesian demographic model results produced by calling caribouBayesianPM()

startYear, endYear

year defining the beginning of the observation period and the end of the projection period.

paramTable

data.frame. Optional. Scenario parameters see simulateObservations()

exData

data.frame. Optional. Output of simulateObservations() that records the true population metrics of the population that observations were simulated from.

simInitial

Initial simulation results, produced by calling getSimsInitial()

Value

a list of tables:

  • rr.summary.all: Mean parameter values for each year and standard deviation, upper and lower credible intervals projected by the Bayesian model, as well as scenario input parameters.

  • sim.all: Mean parameter values and upper and lower credible intervals from the initial model for each year, as well as scenario input parameters.

  • obs.all: Observed parameter values with column "Type" identifying if it is the "true" value of the simulated population or the "observed" value simulated based on the collaring program parameters.

Examples

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

simO <- simulateObservations(scns)

out <- caribouBayesianPM(surv_data = simO$simSurvObs, recruit_data = simO$simRecruitObs,
                          disturbance = simO$simDisturbance,
                          niters=10)
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 10
#>    Unobserved stochastic nodes: 33
#>    Total graph size: 665
#> 
#> Initializing model
#> 
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 29
#>    Unobserved stochastic nodes: 70
#>    Total graph size: 694
#> 
#> Initializing model
#> 

outTables <- getOutputTables(out, exData = simO$exData, paramTable = simO$paramTable,
                             simInitial = getSimsInitial())
#> Warning: Setting expected survival S_bar to be between l_S and h_S.
#> Updating cached initial simulations.
                             
str(outTables, max.level = 2, give.attr = FALSE)
#> List of 3
#>  $ rr.summary.all:'data.frame':	190 obs. of  40 variables:
#>   ..$ Year              : num [1:190] 2014 2014 2014 2014 2014 ...
#>   ..$ MetricTypeID      : chr [1:190] "c" "survival" "lambda" "X" ...
#>   ..$ PopulationName    : chr [1:190] "A" "A" "A" "A" ...
#>   ..$ AnthroID          : num [1:190] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ fire_excl_anthroID: num [1:190] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ Mean              : num [1:190] NaN 0.935 1.147 0.226 0.436 ...
#>   ..$ lower             : Named num [1:190] NA 0.825 1.009 0.188 0.373 ...
#>   ..$ upper             : Named num [1:190] NA 0.986 1.229 0.272 0.503 ...
#>   ..$ probViable        : num [1:190] NaN 0 0.983 0 0 ...
#>   ..$ Parameter         : chr [1:190] "c" "Adult female survival" "Population growth rate" "Adjusted recruitment" ...
#>   ..$ Anthro            : num [1:190] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ fire_excl_anthro  : num [1:190] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ time              : num [1:190] 1 1 1 1 1 1 1 1 1 1 ...
#>   ..$ Total_dist        : num [1:190] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ iFire             : num [1:190] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ iAnthro           : num [1:190] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ obsAnthroSlope    : num [1:190] 1 1 1 1 1 1 1 1 1 1 ...
#>   ..$ projAnthroSlope   : num [1:190] 5 5 5 5 5 5 5 5 5 5 ...
#>   ..$ rSlopeMod         : num [1:190] 1 1 1 1 1 1 1 1 1 1 ...
#>   ..$ sSlopeMod         : num [1:190] 1 1 1 1 1 1 1 1 1 1 ...
#>   ..$ correlateRates    : logi [1:190] FALSE FALSE FALSE FALSE FALSE FALSE ...
#>   ..$ projYears         : num [1:190] 10 10 10 10 10 10 10 10 10 10 ...
#>   ..$ obsYears          : num [1:190] 10 10 10 10 10 10 10 10 10 10 ...
#>   ..$ preYears          : num [1:190] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ N0                : num [1:190] 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 ...
#>   ..$ qMin              : num [1:190] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ qMax              : num [1:190] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ uMin              : num [1:190] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ uMax              : num [1:190] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ zMin              : num [1:190] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ zMax              : num [1:190] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ cowMult           : num [1:190] 5 5 5 5 5 5 5 5 5 5 ...
#>   ..$ collarCount       : num [1:190] 20 20 20 20 20 20 20 20 20 20 ...
#>   ..$ interannualVar    :List of 190
#>   ..$ curYear           : num [1:190] 2023 2023 2023 2023 2023 ...
#>   ..$ ID                : int [1:190] 1 1 1 1 1 1 1 1 1 1 ...
#>   ..$ label             : chr [1:190] "ID1_curYear2023_interannualVarlist(R_CV = 0.46, S_CV = 0.08696)_collarCount20_cowMult5_zMax0_zMin0_uMax0_uMin0_"| __truncated__ "ID1_curYear2023_interannualVarlist(R_CV = 0.46, S_CV = 0.08696)_collarCount20_cowMult5_zMax0_zMin0_uMax0_uMin0_"| __truncated__ "ID1_curYear2023_interannualVarlist(R_CV = 0.46, S_CV = 0.08696)_collarCount20_cowMult5_zMax0_zMin0_uMax0_uMin0_"| __truncated__ "ID1_curYear2023_interannualVarlist(R_CV = 0.46, S_CV = 0.08696)_collarCount20_cowMult5_zMax0_zMin0_uMax0_uMin0_"| __truncated__ ...
#>   ..$ startYear         : num [1:190] 2014 2014 2014 2014 2014 ...
#>   ..$ rQuantile         : logi [1:190] NA NA NA NA NA NA ...
#>   ..$ sQuantile         : logi [1:190] NA NA NA NA NA NA ...
#>  $ sim.all       :'data.frame':	160 obs. of  8 variables:
#>   ..$ MetricTypeID  : chr [1:160] "c" "lambda_bar" "recruitment" "lambda" ...
#>   ..$ PopulationName: chr [1:160] "A" "A" "A" "A" ...
#>   ..$ Mean          : num [1:160] 1 1.034 0.345 1.025 0.172 ...
#>   ..$ lower         : Named num [1:160] 1 0.8986 0.0855 0.757 0.0427 ...
#>   ..$ upper         : Named num [1:160] 1 1.172 0.727 1.279 0.363 ...
#>   ..$ probViable    : num [1:160] 1 0.742 0 0.617 0 0.063 0 0 0 1 ...
#>   ..$ Parameter     : chr [1:160] "c" "Expected growth rate" "Recruitment" "Population growth rate" ...
#>   ..$ Year          : int [1:160] 2014 2014 2014 2014 2014 2014 2014 2014 2015 2015 ...
#>  $ obs.all       :'data.frame':	259 obs. of  36 variables:
#>   ..$ Year            : num [1:259] 2014 2014 2014 2014 2014 ...
#>   ..$ PopulationName  : chr [1:259] "A" "A" "A" "A" ...
#>   ..$ Mean            : num [1:259] 0.44 0.397 0.9 975 1 ...
#>   ..$ Parameter       : chr [1:259] "Recruitment" "Expected recruitment" "Adult female survival" "Female population size" ...
#>   ..$ MetricTypeID    : chr [1:259] "R" "Rbar" "S" "N" ...
#>   ..$ Type            : chr [1:259] "observed" "true" "observed" "true" ...
#>   ..$ Anthro          : num [1:259] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ fire_excl_anthro: num [1:259] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ time            : num [1:259] 1 1 1 1 1 1 1 1 1 1 ...
#>   ..$ Total_dist      : num [1:259] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ iFire           : num [1:259] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ iAnthro         : num [1:259] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ obsAnthroSlope  : num [1:259] 1 1 1 1 1 1 1 1 1 1 ...
#>   ..$ projAnthroSlope : num [1:259] 5 5 5 5 5 5 5 5 5 5 ...
#>   ..$ rSlopeMod       : num [1:259] 1 1 1 1 1 1 1 1 1 1 ...
#>   ..$ sSlopeMod       : num [1:259] 1 1 1 1 1 1 1 1 1 1 ...
#>   ..$ correlateRates  : logi [1:259] FALSE FALSE FALSE FALSE FALSE FALSE ...
#>   ..$ projYears       : num [1:259] 10 10 10 10 10 10 10 10 10 10 ...
#>   ..$ obsYears        : num [1:259] 10 10 10 10 10 10 10 10 10 10 ...
#>   ..$ preYears        : num [1:259] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ N0              : num [1:259] 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 ...
#>   ..$ qMin            : num [1:259] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ qMax            : num [1:259] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ uMin            : num [1:259] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ uMax            : num [1:259] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ zMin            : num [1:259] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ zMax            : num [1:259] 0 0 0 0 0 0 0 0 0 0 ...
#>   ..$ cowMult         : num [1:259] 5 5 5 5 5 5 5 5 5 5 ...
#>   ..$ collarCount     : num [1:259] 20 20 20 20 20 20 20 20 20 20 ...
#>   ..$ interannualVar  :List of 259
#>   ..$ curYear         : num [1:259] 2023 2023 2023 2023 2023 ...
#>   ..$ ID              : int [1:259] 1 1 1 1 1 1 1 1 1 1 ...
#>   ..$ label           : chr [1:259] "ID1_curYear2023_interannualVarlist(R_CV = 0.46, S_CV = 0.08696)_collarCount20_cowMult5_zMax0_zMin0_uMax0_uMin0_"| __truncated__ "ID1_curYear2023_interannualVarlist(R_CV = 0.46, S_CV = 0.08696)_collarCount20_cowMult5_zMax0_zMin0_uMax0_uMin0_"| __truncated__ "ID1_curYear2023_interannualVarlist(R_CV = 0.46, S_CV = 0.08696)_collarCount20_cowMult5_zMax0_zMin0_uMax0_uMin0_"| __truncated__ "ID1_curYear2023_interannualVarlist(R_CV = 0.46, S_CV = 0.08696)_collarCount20_cowMult5_zMax0_zMin0_uMax0_uMin0_"| __truncated__ ...
#>   ..$ startYear       : num [1:259] 2014 2014 2014 2014 2014 ...
#>   ..$ rQuantile       : logi [1:259] NA NA NA NA NA NA ...
#>   ..$ sQuantile       : logi [1:259] NA NA NA NA NA NA ...