View source: R/demographicCoefficients.R
demographicCoefficients | R Documentation |
Select the regression coefficient values and standard errors for the desired
model version (see popGrowthTableJohnsonECCC
for options) and then sample
from the Gaussian distribution for each replicate population.
demographicCoefficients
is a wrapper around getCoefs()
, which selects
coefficients and sampleCoefs()
, which samples coefficients, for both the
survival and recruitment models.
demographicCoefficients(
replicates,
modelVersion = "Johnson",
survivalModelNumber = "M1",
recruitmentModelNumber = "M4",
useQuantiles = TRUE,
populationGrowthTable = popGrowthTableJohnsonECCC
)
getCoefs(populationGrowthTable, resVar, modelVersion, modNum)
sampleCoefs(coefTable, replicates)
replicates |
integer. Number of replicate populations. |
modelVersion |
character. Which model version to use. Currently the only option is "Johnson" for the model used in Johnson et. al. (2020), but additional options may be added in the future. |
survivalModelNumber , recruitmentModelNumber |
character. Which model number to use see popGrowthTableJohnsonECCC for options. |
useQuantiles |
logical or numeric. If it is a numeric vector it must be
length 2 and give the low and high limits of the quantiles to use. If
|
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. |
resVar |
character. Response variable, typically "femaleSurvival" or "recruitment" |
modNum |
character vector. Which model number(s) to use see popGrowthTableJohnsonECCC for typical options. |
coefTable |
data.table. Table must have columns "Coefficient" for the
name of the coefficient, "Value" for the value of the coefficient and
"StdErr" for the standard error of coefficients. Typically created with
|
Each population is optionally assigned to quantiles of the error
distributions for survival and recruitment. Using quantiles means that the
population will stay in these quantiles as disturbance changes over time, so
there is persistent variation in recruitment and survival among example
populations. See demographicRates()
for more details.
For demographicCoefficients
a list with elements:
"modelVersion": The name of the model version
"coefSamples_Survival" and"coefSamples_Recruitment": lists with elements:
"coefSamples": Bootstrapped coefficients with replicates
rows
"coefValues": Coefficient values taken from populationGrowthTable
"quantiles": A vector of randomly selected quantiles between 0.025 and
0.975 with length replicates
For getCoefs
: a named list with one element per model version. The names are
modelVersion_modNum_Type
. Each element contains a data.frame that is a subset
of populationGrowthTable
for the selected model
For sampleCoefs
a list with elements:
"coefSamples": Bootstrapped coefficients with replicates
rows
"coefValues": Coefficient values taken from populationGrowthTable
Johnson, C.A., Sutherland, G.D., Neave, E., Leblond, M., Kirby, P., Superbie, C. and McLoughlin, P.D., 2020. Science to inform policy: linking population dynamics to habitat for a threatened species in Canada. Journal of Applied Ecology, 57(7), pp.1314-1327. https://doi.org/10.1111/1365-2664.13637
Caribou demography functions:
caribouBayesianPM()
,
caribouPopGrowth()
,
compositionBiasCorrection()
,
demographicProjectionApp()
,
demographicRates()
,
getOutputTables()
,
getPriors()
,
getScenarioDefaults()
,
getSimsNational()
,
plotRes()
,
popGrowthTableJohnsonECCC
,
runScnSet()
,
simulateObservations()
# sample coefficients for default models
demographicCoefficients(10)
# try a different model
demographicCoefficients(10, modelVersion = "Johnson", survivalModelNumber = "M1",
recruitmentModelNumber = "M3")
getCoefs(popGrowthTableJohnsonECCC, "femaleSurvival", "Johnson", "M1")
cfs <- getCoefs(popGrowthTableJohnsonECCC, "recruitment", "Johnson", "M3")
sampleCoefs(cfs[[1]], 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.