Skip to contents

Create summary table of demographic rates from survival and recruitment surveys

Usage

estimateBayesianRates(
  surv_data,
  recruit_data,
  N0 = NA,
  disturbance = NULL,
  priors = NULL,
  shiny_progress = FALSE,
  return_mcmc = FALSE,
  i18n = NULL,
  niters = formals(bboutools::bb_fit_survival)$niters,
  nthin = formals(bboutools::bb_fit_survival)$nthin,
  ...
)

Arguments

surv_data

dataframe. Survival data in bboudata format.

recruit_data

dataframe. Recruitment data in bboudata format.

N0

number or dataframe. Optional. Initial population size(s). If NA (default) then population growth rate is $_t=S_t*(1+cR_t)/s$. If a data frame N0 column is required, and PopulationName column is required if there is more than one row. Additional (optional) variation columns will be used by addN0Variation().

disturbance

dataframe. Optional. If provided, fit a Beta model that includes disturbance covariates.

priors

list. Optional. If disturbance is NA, this should be list(priors_survival=c(...),priors_recruitment=c(...)); see bboutools::bb_priors_survival and bboutools::bb_priors_recruitment for details. If disturbance is not NA, see betaNationalPriors for details.

shiny_progress

logical. Should shiny progress bar be updated. Only set to TRUE if using in an app.

return_mcmc

boolean. If TRUE return fitted survival and recruitment models. Default FALSE.

niters

integer. The number of iterations per chain after thinning and burn-in.

nthin

integer. The number of the thinning rate.

...

Other parameters passed on to bboutools::bb_fit_survival and bboutools::bb_fit_recruitment.

Value

If return_mcmc is TRUE then a list with results and fitted models, if FALSE just the results summaries are returned.

Examples

s_data <- rbind(bboudata::bbousurv_a, bboudata::bbousurv_b)
r_data <- rbind(bboudata::bbourecruit_a, bboudata::bbourecruit_b)
estimateBayesianRates(s_data, r_data, N0 = 500)
#>   PopulationName     R_bar       R_sd R_iv_mean R_iv_shape R_bar_lower
#> 1              A 0.1992917 0.07864209 0.2728783   6.826044   0.1750137
#> 2              B 0.2114278 0.10012394 0.2728783   6.826044   0.1794745
#>   R_bar_upper     S_bar      S_sd S_iv_mean S_iv_shape S_bar_lower S_bar_upper
#> 1   0.2237109 0.8822584 0.2436239 0.4976163   13.14067   0.8284404   0.9255020
#> 2   0.2453465 0.9071013 0.2944202 0.4976163   13.14067   0.8488691   0.9458972
#>    N0 nCollarYears nSurvYears nCowsAllYears nRecruitYears
#> 1 500          900         31          2047            27
#> 2 500          519         18          1645            15