sim_km_mort: Simulate natural, per kilometer survival

View source: R/sim_km_mort.R

sim_km_mortR Documentation

Simulate natural, per kilometer survival

Description

Function used to simulate mortality per kilometer from the empirical cumulative distribution function used by Stevens et al. (2019).

Usage

sim_km_mort(prop_lost_per_km, n, prob)

Arguments

prop_lost_per_km

Proportion of fish lost per kilometer

n

Number of values to sample

prob

Sampling probabilities for cdf based on Stevens et al. (2019).

Details

A wrapper for the 'sample()' function for resampling the empirical cumulative distribution function included in the mort_per_km data set.

References

Stevens, JR, JF Kocik, and TF Sheehan. 2019. Modeling the impacts of dams and stocking practices on an endangered Atlantic salmon (Salmo salar) population in the Penobscot River, Maine, USA. Canadian Journal of Fisheries and Aquatic Sciences 76:1795-1807.

Examples

# Simulate 
morts <- sim_km_mort(
  prop_lost_per_km = penPass::mort_per_km$prop_lost_per_km,
  n = 1000,
  prob = penPass::mort_per_km$prob
)

# Calculate number surviving from 1000 starting individuals
surv <- 1e3 - (1e3 * exp(-morts)) 
hist( surv, breaks = 40 )


danStich/penPass documentation built on July 1, 2023, 9:31 a.m.