sim_km_mort | R Documentation |
Function used to simulate mortality per kilometer from the empirical cumulative distribution function used by Stevens et al. (2019).
sim_km_mort(prop_lost_per_km, n, prob)
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). |
A wrapper for the 'sample()' function for resampling the empirical
cumulative distribution function included in the mort_per_km
data set.
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.
# 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 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.