Title: | Simulate Boreal Caribou Survival, Recruitment and Population Growth |
---|---|
Description: | Simulates survival and recruitment data for boreal caribou populations using hierarchical Bayesian models. |
Authors: | Seb Dalgarno [aut, cre] , Joe Thorley [aut] , John Boulanger [aut] , Ayla Pearson [aut], Environment and Climate Change Canada [cph] |
Maintainer: | Seb Dalgarno <[email protected]> |
License: | Apache License (== 2.0) | file LICENSE |
Version: | 0.1.0 |
Built: | 2024-11-29 04:26:31 UTC |
Source: | https://github.com/poissonconsulting/bbousims |
Matrix x should be a process matrix with identical number of rows and columns. Matrix y should have one column, with each row indicating abundance at a given stage. The number of rows must be identical to the number of columns in x. A binomial distribution is used, where size is drawn from the y matrix and prob is drawn from the x matrix.
x %*b% y
x %*b% y
x |
A matrix with identical number of rows and columns. |
y |
A vector or matrix with one column. |
A vector of the projected abundance for each stage.
population0 <- c(148, 82, 111, 99) survival_mat <- bbs_matrix_survival(c(0.845, 0.872, 0.859, 0.861)) survival_mat %*b% population0
population0 <- c(148, 82, 111, 99) survival_mat <- bbs_matrix_survival(c(0.845, 0.872, 0.859, 0.861)) survival_mat %*b% population0
Matrix x should be a process matrix with identical number of rows and columns. Matrix y should have one column, with each row indicating abundance at a given stage. The number of rows must be identical to the number of columns in x. A binomial distribution is used, where size is drawn from the y matrix and prob is drawn from the x matrix.
x %*b2% y
x %*b2% y
x |
A matrix with identical number of rows and columns. |
y |
A vector or matrix with one column. |
A vector of the projected abundance for each stage.
population0 <- c(148, 82, 111, 99) survival_mat <- bbs_matrix_survival(c(0.845, 0.872, 0.859, 0.861)) survival_mat %*b% population0
population0 <- c(148, 82, 111, 99) survival_mat <- bbs_matrix_survival(c(0.845, 0.872, 0.859, 0.861)) survival_mat %*b% population0
Generate calf-cow ratio, DeCesare recruitment, lambda, leslie matrix and stable-stage distribution from demographic parameters.
bbs_demographic_summary( calves_per_adult_female = 0.7, survival_adult_female = 0.85, survival_calf = 0.5, survival_yearling = survival_adult_female, proportion_female = 0.5 )
bbs_demographic_summary( calves_per_adult_female = 0.7, survival_adult_female = 0.85, survival_calf = 0.5, survival_yearling = survival_adult_female, proportion_female = 0.5 )
calves_per_adult_female |
A number of the calves per adult female. |
survival_adult_female |
A number between 0 and 1 of the annual female adult survival. |
survival_calf |
number between 0 and 1 of the annual calf survival. |
survival_yearling |
A number between 0 and 1 of the annual yearling survival. |
proportion_female |
A number between 0 and 1 indicating the proportion of recruits that are female. |
A named list of the calf-cow ratio, DeCesare recruitment, leslie matrix, lambda estimate and stable-stage distribution.
bbs_demographic_summary()
bbs_demographic_summary()
Year is scaled to Year - 1 for trend, which ensures that the intercept is the rate in the first year.
bbs_fecundity( intercept, trend = rep(0, length(intercept)), annual_sd = rep(0, length(intercept)), nyear = 10 )
bbs_fecundity( intercept, trend = rep(0, length(intercept)), annual_sd = rep(0, length(intercept)), nyear = 10 )
intercept |
A vector of the intercept of the log-odds fecundity by stage. If NA, fecundity is set to 0 for all years. |
trend |
A vector of the effect of an increase of one year on the log-odds fecundity by stage. |
annual_sd |
A vector of the standard deviation of the annual variation on the log-odds fecundity by stage. |
nyear |
A whole number of the number of years. |
A matrix of fecundity rates with dimensions year and stage.
bbs_fecundity(c(NA, logit(0.4)), trend = c(NA, 0.1), annual_sd = c(NA, 0.05))
bbs_fecundity(c(NA, logit(0.4)), trend = c(NA, 0.1), annual_sd = c(NA, 0.05))
Year is scaled to Year - 1 for trend, which ensures that calves_per_adult_female
is the rate in the first year.
bbs_fecundity_caribou( calves_per_adult_female, trend = 0, annual_sd = 0, nyear = 10 )
bbs_fecundity_caribou( calves_per_adult_female, trend = 0, annual_sd = 0, nyear = 10 )
calves_per_adult_female |
A number of the calves per adult female. |
trend |
A number of the effect of an increase of one year on the log-odds calves per adult female. |
annual_sd |
A number of the standard deviation of the annual variation on the log-odds calves per adult female. |
nyear |
A whole number of the number of years. |
A matrix of fecundity rates with dimensions year and stage.
bbs_fecundity_caribou(0.4, trend = 0.1, annual_sd = 0.3)
bbs_fecundity_caribou(0.4, trend = 0.1, annual_sd = 0.3)
Create an age process matrix.
bbs_matrix_age(age = c(2, 3, 3))
bbs_matrix_age(age = c(2, 3, 3))
age |
A vector indicating the stage to age into. If ageing does not occur, the stage should reference itself. |
A matrix of the age subprocess.
bbs_matrix_age(c(2, 3, 3)) %*% c(80, 50, 150)
bbs_matrix_age(c(2, 3, 3)) %*% c(80, 50, 150)
Create a birth process matrix.
bbs_matrix_birth( fecundity, female_recruit_stage = 1, male_recruit_stage = NULL, proportion_female = 0.5 )
bbs_matrix_birth( fecundity, female_recruit_stage = 1, male_recruit_stage = NULL, proportion_female = 0.5 )
fecundity |
A vector of the fecundity rates in each stage. |
female_recruit_stage |
A positive whole number of the stage representing female recruits. |
male_recruit_stage |
A positive whole number of the stage representing male recruits. Ignored if NULL. |
proportion_female |
A number between 0 and 1 indicating the proportion of recruits that are female. |
A birth process matrix.
bbs_matrix_birth(c(0, 0, 0.2, 0, 0.25, 0)) %*% rep(100, 6)
bbs_matrix_birth(c(0, 0, 0.2, 0, 0.25, 0)) %*% rep(100, 6)
Create a birth process matrix for each year.
bbs_matrix_birth_year( fecundity, female_recruit_stage = 1, male_recruit_stage = NULL, proportion_female = 0.5 )
bbs_matrix_birth_year( fecundity, female_recruit_stage = 1, male_recruit_stage = NULL, proportion_female = 0.5 )
fecundity |
A matrix of the fecundity rates with dimensions year and stage. |
female_recruit_stage |
A positive whole number of the stage representing female recruits. |
male_recruit_stage |
A positive whole number of the stage representing male recruits. Ignored if NULL. |
proportion_female |
A number between 0 and 1 indicating the proportion of recruits that are female. |
An array of the birth process matrices with dimensions stage, stage, year.
fec <- bbs_fecundity(c(NA, 0.7), nyear = 3) bbs_matrix_birth_year(fec$eFecundity)
fec <- bbs_fecundity(c(NA, 0.7), nyear = 3) bbs_matrix_birth_year(fec$eFecundity)
Create a survival process matrix.
bbs_matrix_survival(survival)
bbs_matrix_survival(survival)
survival |
A vector of the survival rates in each stage. |
A matrix of the survival subprocess.
bbs_matrix_survival(c(0.5, 0.83, 0.84)) %*% rep(100, 3)
bbs_matrix_survival(c(0.5, 0.83, 0.84)) %*% rep(100, 3)
Create survival matrix for each year and period.
bbs_matrix_survival_period(survival)
bbs_matrix_survival_period(survival)
survival |
An array of the survival rates with dimensions period, year and stage. Period represents any subdivision of a year (i.e., week, month, season). |
An array of survival process matrices with dimensions stage, stage, year, period.
survival_rates <- bbs_survival(logit(c(0.94, 0.98)), nyear = 2, nperiod_within_year = 1) bbs_matrix_survival_period(survival_rates$eSurvival)
survival_rates <- bbs_survival(logit(c(0.94, 0.98)), nyear = 2, nperiod_within_year = 1) bbs_matrix_survival_period(survival_rates$eSurvival)
Plots population abundance by period and stage.
bbs_plot_population(x, ...) ## S3 method for class 'data.frame' bbs_plot_population(x, annual = TRUE, ...) ## S3 method for class 'bbou_population' bbs_plot_population(x, annual = TRUE, nperiod_within_year = 12, ...) ## S3 method for class 'bbou_simulation' bbs_plot_population(x, annual = TRUE, alpha = 0.5, ...) ## S3 method for class 'bbou_population_caribou' bbs_plot_population(x, annual = TRUE, ...)
bbs_plot_population(x, ...) ## S3 method for class 'data.frame' bbs_plot_population(x, annual = TRUE, ...) ## S3 method for class 'bbou_population' bbs_plot_population(x, annual = TRUE, nperiod_within_year = 12, ...) ## S3 method for class 'bbou_simulation' bbs_plot_population(x, annual = TRUE, alpha = 0.5, ...) ## S3 method for class 'bbou_population_caribou' bbs_plot_population(x, annual = TRUE, ...)
x |
The object. |
... |
Unused parameters. |
annual |
A flag indicating whether to show annual population (as opposed to monthly). |
nperiod_within_year |
A whole number of the number of periods in a year. |
alpha |
A number between 0 and 1 of the point transparency. |
A ggplot object.
A ggplot object.
A ggplot object.
A ggplot object.
bbs_plot_population(data.frame)
: Plot population abundance by period and stage for a data frame (abundance data.frame in output bbs_simulate_caribou()
).
bbs_plot_population(bbou_population)
: Plot population abundance by period and stage for a matrix (output of bbs_population_caribou()
).
bbs_plot_population(bbou_simulation)
: Plot population abundance by period and stage for a matrix (output of bbs_simulate_caribou()
).
bbs_plot_population(bbou_population_caribou)
: Plot population abundance by period and stage for a matrix (output of bbs_simulate_caribou()
).
survival <- bbs_survival_caribou(0.84) fecundity <- bbs_fecundity_caribou(0.7) x <- bbs_simulate_caribou(survival, fecundity = fecundity) bbs_plot_population(x[[1]]$abundance) pop0 <- c(100, 200) survival <- bbs_survival(intercept = logit(c(0.95, 0.98))) fecundity <- bbs_fecundity(intercept = c(NA, logit(0.4))) survival_mat <- bbs_matrix_survival_period(survival$eSurvival) birth_mat <- bbs_matrix_birth_year(fecundity$eFecundity) age_mat <- bbs_matrix_age(c(2, 2)) x <- bbs_population(pop0, birth = birth_mat, age = age_mat, survival = survival_mat ) bbs_plot_population(x) survival <- bbs_survival_caribou(0.84) fecundity <- bbs_fecundity_caribou(0.7) x <- bbs_simulate_caribou(survival, fecundity = fecundity, nsims = 3) bbs_plot_population(x, alpha = 0.7) survival <- bbs_survival_caribou(0.84) fecundity <- bbs_fecundity_caribou(0.7) x <- bbs_population_caribou(survival, fecundity = fecundity) bbs_plot_population(x)
survival <- bbs_survival_caribou(0.84) fecundity <- bbs_fecundity_caribou(0.7) x <- bbs_simulate_caribou(survival, fecundity = fecundity) bbs_plot_population(x[[1]]$abundance) pop0 <- c(100, 200) survival <- bbs_survival(intercept = logit(c(0.95, 0.98))) fecundity <- bbs_fecundity(intercept = c(NA, logit(0.4))) survival_mat <- bbs_matrix_survival_period(survival$eSurvival) birth_mat <- bbs_matrix_birth_year(fecundity$eFecundity) age_mat <- bbs_matrix_age(c(2, 2)) x <- bbs_population(pop0, birth = birth_mat, age = age_mat, survival = survival_mat ) bbs_plot_population(x) survival <- bbs_survival_caribou(0.84) fecundity <- bbs_fecundity_caribou(0.7) x <- bbs_simulate_caribou(survival, fecundity = fecundity, nsims = 3) bbs_plot_population(x, alpha = 0.7) survival <- bbs_survival_caribou(0.84) fecundity <- bbs_fecundity_caribou(0.7) x <- bbs_population_caribou(survival, fecundity = fecundity) bbs_plot_population(x)
Simulate population projections given initial population in each stage and survival, ageing, and birth process matrices. Survival can vary by period (e.g., month) and year, birth can vary by year, and ageing is constant. This model assumes that survival occurs at the end of each period and survival, ageing and birth occur at the end of each year, in that order. The dimensions of birth, age and survival process matrices must be identical to the length of the initial population vector.
bbs_population(population_init, birth, age, survival, stochastic = TRUE)
bbs_population(population_init, birth, age, survival, stochastic = TRUE)
population_init |
A vector of the initial population for each stage. |
birth |
An array of the birth matrices (output of |
age |
An age process matrix (output of bbs_matrix_age). |
survival |
An array of the survival matrices (output of |
stochastic |
A flag indicating whether to include demographic stochasticity. |
A matrix of the population by stage and period.
pop0 <- c(100, 200) survival <- bbs_survival(intercept = logit(c(0.95, 0.98))) fecundity <- bbs_fecundity(intercept = c(NA, logit(0.4))) survival_mat <- bbs_matrix_survival_period(survival$eSurvival) birth_mat <- bbs_matrix_birth_year(fecundity$eFecundity) age_mat <- bbs_matrix_age(c(2, 2)) x <- bbs_population(pop0, birth = birth_mat, age = age_mat, survival = survival_mat )
pop0 <- c(100, 200) survival <- bbs_survival(intercept = logit(c(0.95, 0.98))) fecundity <- bbs_fecundity(intercept = c(NA, logit(0.4))) survival_mat <- bbs_matrix_survival_period(survival$eSurvival) birth_mat <- bbs_matrix_birth_year(fecundity$eFecundity) age_mat <- bbs_matrix_age(c(2, 2)) x <- bbs_population(pop0, birth = birth_mat, age = age_mat, survival = survival_mat )
Simulate population projection for Boreal Caribou from key survival and fecundity rates.
bbs_population_caribou( survival, fecundity, adult_females = 1000, proportion_adult_female = 0.65, proportion_yearling_female = 0.5, stochastic = TRUE )
bbs_population_caribou( survival, fecundity, adult_females = 1000, proportion_adult_female = 0.65, proportion_yearling_female = 0.5, stochastic = TRUE )
survival |
A list of the Caribou survival rates (output of |
fecundity |
A list of the Caribou fecundity rates (output of |
adult_females |
A number of the initial number of adult females in the population. |
proportion_adult_female |
A number between 0 and 1 of the proportion of adults that are female. |
proportion_yearling_female |
A number between 0 and 1 of the proportion of yearlings that are female. |
stochastic |
A flag indicating whether to include demographic stochasticity. |
This model assumes that survival occurs at the end of each period and survival, ageing and birth occur at the end of each year, in that order.
Initial population size for all stages is determined from the initial number of adult females and the calculated stable stage distribution.
Survival and fecundity arguments accept outputs of bbs_survival_caribou()
and bbs_fecundity_caribou()
.
These are converted into processes matrices using bbs_matrix_survival_period()
and bbs_matrix_birth_year()
prior to projection.
bbs_population()
is called internally to project population.
Yearling female survival is assumed to be the same as adult female survival.
Stages 1-6 in output matrix correspond to female calf, male calf, female yearling, male yearling, female adult and male adult, respectively.
A matrix of the population by stage and period.
survival <- bbs_survival_caribou(0.84) fecundity <- bbs_fecundity_caribou(0.7) x <- bbs_population_caribou(survival, fecundity = fecundity)
survival <- bbs_survival_caribou(0.84) fecundity <- bbs_fecundity_caribou(0.7) x <- bbs_population_caribou(survival, fecundity = fecundity)
In each period the population is assigned into groups. Group sizes are drawn randomly from a gamma-poisson distribution with specified lambda and theta. Group sizes are drawn until the cumulative size exceeds the total individuals. The remaining individuals comprise the final group. If the remaining number of individuals is < min_size specified, these will be added to the previous group. Groups are filled by drawing individuals randomly.
bbs_population_groups( population, group_size_lambda = 5, group_size_theta = 2, group_max_proportion = 1/4, group_min_size = 2 )
bbs_population_groups( population, group_size_lambda = 5, group_size_theta = 2, group_max_proportion = 1/4, group_min_size = 2 )
population |
A matrix of the population by stage and period (output of |
group_size_lambda |
A number of the lambda value of the gamma-poisson distribution to draw group sizes from. |
group_size_theta |
A number of the theta value of the gamma-poisson distribution to draw group sizes from. |
group_max_proportion |
A number between 0 and 1 of the maximum group size as proportion of the total population. |
group_min_size |
A whole positive number of the minimum group size. |
A list of groups in each period.
survival <- bbs_survival_caribou(0.84) fecundity <- bbs_fecundity_caribou(0.7) x <- bbs_population_caribou(survival, fecundity = fecundity, adult_females = 100) bbs_population_groups(x)
survival <- bbs_survival_caribou(0.84) fecundity <- bbs_fecundity_caribou(0.7) x <- bbs_population_caribou(survival, fecundity = fecundity, adult_females = 100) bbs_population_groups(x)
In each period the population is assigned into groups. Calf-cow pairs are created and assigned to groups together. Group sizes are drawn randomly from a gamma-poisson distribution with specified lambda and theta. Group sizes are drawn until the cumulative size exceeds the total individuals. The remaining individuals comprise the final group. If the remaining number of individuals is < min_size specified, these will be added to the previous group. Groups are filled by drawing pairs or individuals from the pool. If there is only space for one individual left in a group, the pool of individuals (i.e., not pairs) will be sampled. If there are only pairs left in the pool and one individual is required to fill a group, a pair will be broken up.
bbs_population_groups_pairs( population, group_size_lambda = 5, group_size_theta = 2, group_max_proportion = 1/4, group_min_size = 2, recruit_stages = c(1, 2), reproductive_female_stages = c(3, 5) )
bbs_population_groups_pairs( population, group_size_lambda = 5, group_size_theta = 2, group_max_proportion = 1/4, group_min_size = 2, recruit_stages = c(1, 2), reproductive_female_stages = c(3, 5) )
population |
A matrix of the population by stage and period (output of |
group_size_lambda |
A number of the lambda value of the gamma-poisson distribution to draw group sizes from. |
group_size_theta |
A number of the theta value of the gamma-poisson distribution to draw group sizes from. |
group_max_proportion |
A number between 0 and 1 of the maximum group size as proportion of the total population. |
group_min_size |
A whole positive number of the minimum group size. |
recruit_stages |
A vector of whole numbers indicating the recruit stages (e.g., calf). |
reproductive_female_stages |
A vector of whole numbers indicating the reproductive female stages (e.g., cows). |
A list of groups for each period.
survival <- bbs_survival_caribou(0.84) fecundity <- bbs_fecundity_caribou(0.7) x <- bbs_population_caribou(survival, fecundity = fecundity, adult_females = 100) bbs_population_groups_pairs(x)
survival <- bbs_survival_caribou(0.84) fecundity <- bbs_fecundity_caribou(0.7) x <- bbs_population_caribou(survival, fecundity = fecundity, adult_females = 100) bbs_population_groups_pairs(x)
See bbs_population_groups()
for details on group assignment.
Groups are sampled in each composition survey in proportion to group_coverage
.
bbs_population_groups_survey( population, month_composition = 9, group_size_lambda = 5, group_size_theta = 2, group_max_proportion = 1/4, group_min_size = 2, group_coverage = 0.2 )
bbs_population_groups_survey( population, month_composition = 9, group_size_lambda = 5, group_size_theta = 2, group_max_proportion = 1/4, group_min_size = 2, group_coverage = 0.2 )
population |
A matrix of the population by stage and period (output of |
month_composition |
A whole number between 1 and 12 of the month that composition surveys take place, relative to the start of the biological year. |
group_size_lambda |
A number of the lambda value of the gamma-poisson distribution to draw group sizes from. |
group_size_theta |
A number of the theta value of the gamma-poisson distribution to draw group sizes from. |
group_max_proportion |
A number between 0 and 1 of the maximum group size as proportion of the total population. |
group_min_size |
A whole positive number of the minimum group size. |
group_coverage |
A number between 0 and 1 of the proportion of groups sampled. |
A list of observed groups in each composition survey.
survival <- bbs_survival_caribou(0.84) fecundity <- bbs_fecundity_caribou(0.7) x <- bbs_population_caribou(survival, fecundity = fecundity, adult_females = 100) bbs_population_groups_survey(x, group_coverage = 0.1)
survival <- bbs_survival_caribou(0.84) fecundity <- bbs_fecundity_caribou(0.7) x <- bbs_population_caribou(survival, fecundity = fecundity, adult_females = 100) bbs_population_groups_survey(x, group_coverage = 0.1)
Simulate Boreal Caribou data from survival rates, fecundity rates and sampling parameters.
bbs_simulate_caribou( survival, fecundity, nsims = 1, adult_females = 500, proportion_adult_female = 0.65, proportion_yearling_female = 0.5, probability_unsexed_adult_female = 0, probability_unsexed_adult_male = 0, month_composition = 9L, group_size = 5, group_coverage = 0.3, group_min_size = 2, group_max_proportion = 1, collared_adult_females = 30, month_collar = 1L, probability_uncertain_mortality = 0, probability_uncertain_survival = 0, population_name = "A" )
bbs_simulate_caribou( survival, fecundity, nsims = 1, adult_females = 500, proportion_adult_female = 0.65, proportion_yearling_female = 0.5, probability_unsexed_adult_female = 0, probability_unsexed_adult_male = 0, month_composition = 9L, group_size = 5, group_coverage = 0.3, group_min_size = 2, group_max_proportion = 1, collared_adult_females = 30, month_collar = 1L, probability_uncertain_mortality = 0, probability_uncertain_survival = 0, population_name = "A" )
survival |
A list of the Caribou survival rates (output of |
fecundity |
A list of the Caribou fecundity rates (output of |
nsims |
A whole positive number of the number of simulations. |
adult_females |
A number of the initial number of adult females in the population. |
proportion_adult_female |
A number between 0 and 1 of the proportion of adults that are female. |
proportion_yearling_female |
A number between 0 and 1 of the proportion of yearlings that are female. |
probability_unsexed_adult_female |
A number between 0 and 1 of the probability that an adult female is unsexed. |
probability_unsexed_adult_male |
A number between 0 and 1 of the probability that an adult male is unsexed. |
month_composition |
A whole number between 1 and 12 of the month that composition surveys take place, relative to the start of the biological year. |
group_size |
A whole number of the average group size. Group sizes are drawn from a poisson distribution with lambda of |
group_coverage |
A number between 0 and 1 of the proportion of groups sampled. |
group_min_size |
A whole positive number of the minimum group size. |
group_max_proportion |
A number between 0 and 1 of the maximum group size as proportion of the total population. |
collared_adult_females |
A whole positive number of the number of collared adult females.
The number of collared adult females is 'topped up' each year at |
month_collar |
A whole number between 1 and 12 of the collaring month. |
probability_uncertain_mortality |
A number between 0 and 1 of the probability of uncertain mortality. |
probability_uncertain_survival |
A number between 0 and 1 of the probability of uncertain survival. |
population_name |
A string of the population name. This does not affect simulation but can be used as a unique identifier. |
See bbs_survival_caribou()
and bbs_fecundity_caribou()
for generating survival and fecundity rates.
See bbs_population_caribou()
for details on how population is simulated.
See bbs_population_groups_survey()
for details on how groups are assigned for each composition survey.
See bbs_survival_collared()
for details on how survival of collared adult female is determined.
Survival and recrutiment data.frames generated are formatted to be used as input data to bboutools::bb_fit_survival()
and bboutools::bb_fit_recruitment()
, respectively.
A list of three tibbles. The first named survival has columns Year, Month, StartTotal, MortalitiesCertain and MortalitiesUncertain. The second named recruitment has columns Year, Month, Cows, Bulls, UnknownAdults, Yearlings and Calves. And the final named abundance has columns Year, Month, Stage, Abundance.
survival <- bbs_survival_caribou(0.84) fecundity <- bbs_fecundity_caribou(0.7) caribou <- bbs_simulate_caribou(survival, fecundity = fecundity, nsims = 2)
survival <- bbs_survival_caribou(0.84) fecundity <- bbs_fecundity_caribou(0.7) caribou <- bbs_simulate_caribou(survival, fecundity = fecundity, nsims = 2)
Each stage can vary by intercept, year trend, annual random effect, period random effect and period within annual random effect. All values are provided on the log-odds scale. Variation from random effects is stochastic. Year is scaled to Year - 1 for trend, which ensures that the intercept is the rate in the first year.
bbs_survival( intercept, nyear = 10, trend = rep(0, length(intercept)), annual_sd = rep(0, length(intercept)), period_sd = rep(0, length(intercept)), annual_period_sd = rep(0, length(intercept)), nperiod_within_year = 12 )
bbs_survival( intercept, nyear = 10, trend = rep(0, length(intercept)), annual_sd = rep(0, length(intercept)), period_sd = rep(0, length(intercept)), annual_period_sd = rep(0, length(intercept)), nperiod_within_year = 12 )
intercept |
A vector of the intercept of the log-odds survival by stage. |
nyear |
A whole number of the number of years. |
trend |
A vector of the effect of an increase of one year on the log-odds survival by stage. |
annual_sd |
A vector of the standard deviation of the annual variation of the log-odds survival by stage. |
period_sd |
A vector of the standard deviation of the period variation of the log-odds survival by stage. |
annual_period_sd |
A vector of the standard deviation of the period within annual variation on the log-odds survival by stage. |
nperiod_within_year |
A whole number of the number of periods in a year. |
An array of survival rates with dimensions period, year, stage.
survival <- bbs_survival(intercept = logit(c(0.94, 0.98, 0.98)), trend = c(0, 0, 0.2))
survival <- bbs_survival(intercept = logit(c(0.94, 0.98, 0.98)), trend = c(0, 0, 0.2))
Stages include female calves, female yearlings and female adults. Calf and adult female survival can vary by trend, annual random effect, month random effect and month within annual random effect. Yearling survival is created as an effect on adult female survival rates. Variation from random effects is stochastic. Year is scaled to Year - 1 for trend, which ensures that the intercept is the rate in the first year.
bbs_survival_caribou( survival_adult_female, survival_calf_female = 0.5, nyear = 10, trend_adult_female = 0, annual_sd_adult_female = 0, month_sd_adult_female = 0, annual_month_sd_adult_female = 0, trend_calf_female = 0, annual_sd_calf_female = 0, month_sd_calf_female = 0, annual_month_sd_calf_female = 0, yearling_effect = 0 )
bbs_survival_caribou( survival_adult_female, survival_calf_female = 0.5, nyear = 10, trend_adult_female = 0, annual_sd_adult_female = 0, month_sd_adult_female = 0, annual_month_sd_adult_female = 0, trend_calf_female = 0, annual_sd_calf_female = 0, month_sd_calf_female = 0, annual_month_sd_calf_female = 0, yearling_effect = 0 )
survival_adult_female |
A number between 0 and 1 of the annual female adult survival. |
survival_calf_female |
A number between 0 and 1 of the annual female calf survival. |
nyear |
A whole number of the number of years. |
trend_adult_female |
A number of the effect of an increase of one year on the log-odds adult female monthly survival. |
annual_sd_adult_female |
A number of the standard deviation of the annual variation in adult female survival on the log-odds monthly survival. |
month_sd_adult_female |
A number of the standard deviation of the monthly variation in adult female survival on the log-odds monthly survival. |
annual_month_sd_adult_female |
A number of the standard deviation of the monthly variation within year variation in adult female survival on the log-odds monthly survival. |
trend_calf_female |
A number of the effect of an increase of one year on the log-odds calf female monthly survival. |
annual_sd_calf_female |
A number of the standard deviation of the annual variation in calf female survival on the log-odds monthly survival. |
month_sd_calf_female |
A number of the standard deviation of the monthly variation in calf female survival on the log-odds monthly survival. |
annual_month_sd_calf_female |
A number of the standard deviation of the monthly variation within year variation in calf female survival on the log-odds monthly survival. |
yearling_effect |
A number of the effect of yearling on the log-odds adult female monthly survival. |
An array of survival rates with dimensions month, year, stage.
survival <- bbs_survival_caribou(0.84, survival_calf_female = 0.5)
survival <- bbs_survival_caribou(0.84, survival_calf_female = 0.5)
The number of collared adult females is 'topped up' at each month_collar
.
Survival rates in each month/year determine the number of mortalities.
The probability of uncertain mortality determines the proportion of mortalities that are uncertain.
The probability of uncertain survival reduces the number of collared adult females without adding mortalities.
bbs_survival_collared( collared_adult_females, survival_adult_female_month_year, probability_uncertain_mortality = 0, probability_uncertain_survival = 0, month_collar = 1L, population_name = "A" )
bbs_survival_collared( collared_adult_females, survival_adult_female_month_year, probability_uncertain_mortality = 0, probability_uncertain_survival = 0, month_collar = 1L, population_name = "A" )
collared_adult_females |
A whole positive number of the number of collared adult females.
The number of collared adult females is 'topped up' each year at |
survival_adult_female_month_year |
A matrix of the female adult survival rates with dimensions month and year. |
probability_uncertain_mortality |
A number between 0 and 1 of the probability of uncertain mortality. |
probability_uncertain_survival |
A number between 0 and 1 of the probability of uncertain survival. |
month_collar |
A whole number between 1 and 12 of the collaring month. |
population_name |
A string of the population name. This does not affect simulation but can be used as a unique identifier. |
A data.frame of the number of collared adult females, certain mortalities and uncertain mortalities in each year and month.
survival <- bbs_survival_caribou(0.84) survival_adult_female <- survival$eSurvival[, , 3] survival_collared <- bbs_survival_collared( collared_adult_females = 30, survival_adult_female_month_year = survival_adult_female )
survival <- bbs_survival_caribou(0.84) survival_adult_female <- survival$eSurvival[, , 3] survival_collared <- bbs_survival_collared( collared_adult_females = 30, survival_adult_female_month_year = survival_adult_female )
Inverse Logarithmic Transformation
ilog(x)
ilog(x)
x |
A numeric object. |
ilog(10)
ilog(10)