| PaleoPopModel | R Documentation |
R6 class representing a
spatially-explicit demographic-based population model. It extends the
poems class with parameters for the
paleopop_simulator. It inherits functionality for creating a
nested model, whereby a nested template model with fixed parameters is
maintained when a model is cloned for various sampled parameters. Also
provided are extensions to the methods for checking the consistency and
completeness of model parameters.
poems::GenericClass -> poems::GenericModel -> poems::SpatialModel -> poems::SimulationModel -> PaleoPopModel
attachedA list of dynamically attached attributes (name-value pairs).
simulation_functionName (character string) or source path of the default simulation function, which takes a model as an input and returns the simulation results.
model_attributesA vector of model attribute names.
regionA Region (or inherited class) object specifying the study region.
coordinatesData frame (or matrix) of X-Y population coordinates (WGS84) in longitude (degrees West) and latitude (degrees North).
random_seedNumber to seed the random number generation for stochasticity.
time_stepsNumber of simulation time steps.
years_per_stepNumber of years per time step.
populationsNumber of population cells.
initial_abundanceArray (matrix) of initial abundance values at each population cell.
transition_rateRate (numeric) of transition between generations at each time-step.
standard_deviationStandard deviation (numeric) for applying environmental stochasticity to transition rates.
compact_decompositionList containing a compact transposed
(Cholesky) decomposition matrix (t_decomposition_compact_matrix)
and a corresponding map of population indices
(t_decomposition_compact_map), as per
SpatialCorrelation class
attributes.
carrying_capacityArray (or matrix) of carrying capacity values at each population cell (across time).
density_dependenceDensity dependence type ("competition", "logistic", or "ceiling").
growth_rate_maxMaximum growth rate (utilized by density dependence processes).
dispersal_dataList of data frames of non-zero dispersal rates and
indices for constructing a compact dispersal matrix, and optional
changing rates over time, as per class
DispersalGenerator
dispersal_data attribute.
dispersal_target_kTarget population carrying capacity threshold for density dependent dispersal.
harvestBoolean for utilizing harvesting.
harvest_maxProportion harvested per year (annual time scale - not generational).
harvest_gThe "G" parameter in the harvest function.
harvest_zThe "Z" parameter in the harvest function.
harvest_max_nMaximum density per grid cell.
human_densityMatrix of human density (fraction) ($populations rows by $time_steps columns).
abundance_thresholdAbundance threshold (that needs to be exceeded) for each population to persist.
occupancy_thresholdThreshold for the number of populations occupied (that needs to be exceeded) for all populations to persist.
results_selectionList of results selection from ("abundance", "ema", "extirpation", "harvested", "occupancy", "human_density").
attribute_aliasesA list of alternative alias names for model attributes (form: alias = "attribute") to be used with the set and get attributes methods.
template_modelNested template model for fixed (non-sampled) attributes for shallow cloning.
sample_attributesVector of sample attribute names (only).
required_attributesVector of required attribute names (only), i.e. those needed to run a simulation.
error_messagesA vector of error messages encountered when setting model attributes.
warning_messagesA vector of warning messages encountered when setting model attributes.
poems::GenericModel$get_attribute()poems::GenericModel$get_attribute_aliases()poems::SimulationModel$get_attribute_names()poems::SimulationModel$get_attributes()poems::SimulationModel$incomplete_attributes()poems::SimulationModel$inconsistent_attributes()poems::SimulationModel$initialize()poems::SimulationModel$is_complete()poems::SimulationModel$is_consistent()poems::SimulationModel$new_clone()poems::SimulationModel$set_attributes()poems::SimulationModel$set_sample_attributes()list_consistency()Returns a boolean to indicate if (optionally selected or all) model attributes (such as dimensions) are consistent.
PaleoPopModel$list_consistency(params = NULL)
paramsOptional array of parameter/attribute names.
List of booleans (or NAs) to indicate consistency of selected/all attributes.
list_completeness()Returns a list of booleans (or NAs) for each parameter to indicate attributes that are necessary to simulate the model have been set and are consistent/valid.
PaleoPopModel$list_completeness()
List of booleans (or NAs) for each parameter to indicate to indicate completeness (and consistency).
clone()The objects of this class are cloneable with this method.
PaleoPopModel$clone(deep = FALSE)
deepWhether to make a deep clone.
library(poems)
library(raster)
# 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
template_model <- PaleoPopModel$new(simulation_function = "paleopop_simulator", # the default
region = region, years_per_step = 25, # default: 1 year
time_steps = 10)
template_model$required_attributes # more requirements than the SimulationModel object in poems
template_model$is_complete() # the required attributes have not been filled in
template_model#is_consistent() # however, the attributes that are filled in are consistent
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.