View source: R/paleopop_simulator.R
paleopop_simulator | R Documentation |
Simulates a population model customized for paleontological time-scales, optimized for single-generation transitions and large populations, across multiple generations and returns simulation results. Each generational time-step includes:
Density dependence calculations
Environmental stochasticity calculations
Generational transition calculations
Harvest calculations
Dispersal calculations
Results collection
paleopop_simulator(inputs)
inputs |
Nested list/object with named elements:
|
Simulation results as a nested list (as selected):
abundance
Matrix of simulation abundances (populations rows by time_steps columns).
ema
Matrix of expected minimum abundances (populations rows by time_steps columns).
extirpation
Array of extirpation times for each population.
harvested
Matrix of estimated individuals harvested (populations rows by time_steps columns).
occupancy
Array of number of populations occupied at each time-step.
human_density
Matrix of human densities, (populations rows by time_steps columns).
library(raster)
library(poems)
# Ring Island example region
coordinates <- data.frame(x = rep(seq(-178.02, -178.06, -0.01), 5),
y = rep(seq(19.02, 19.06, 0.01), each = 5))
template_raster <- Region$new(coordinates = coordinates)$region_raster # full extent
sealevel_raster <- template_raster
template_raster[][c(7:9, 12:14, 17:19)] <- NA # make Ring Island
sealevel_raster[][c(7:9, 12:14, 17:18)] <- NA
raster_stack <- raster::stack(x = append(replicate(9, template_raster), sealevel_raster))
region <- PaleoRegion$new(template_raster = raster_stack)
# Model template
model_template <- PaleoPopModel$new(
region = region,
time_steps = 10,
years_per_step = 12, # years per generational time-step
standard_deviation = 0.1,
growth_rate_max = 0.6,
harvest = FALSE,
populations = region$region_cells,
initial_abundance = seq(9000, 0, -1000),
transition_rate = 1.0,
carrying_capacity = rep(1000, 17),
dispersal = (!diag(nrow = 17, ncol = 17))*0.05,
density_dependence = "logistic",
dispersal_target_k = 10,
occupancy_threshold = 1,
abundance_threshold = 10,
results_selection = c("abundance")
)
# Simulations
results <- paleopop_simulator(model_template) # input as PaleoPopModel object
inputs <- model_template$get_attributes()
paleopop_simulator(inputs) # input as list of attributes
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.