PaleoPopModel | R Documentation |
R6
class representing a
spatially-explicit demographic-based population model. It extends the
SimulationModel
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
attached
A list of dynamically attached attributes (name-value pairs).
simulation_function
Name (character string) or source path of the default simulation function, which takes a model as an input and returns the simulation results.
model_attributes
A vector of model attribute names.
region
A Region
(or inherited class) object specifying the study region.
coordinates
Data frame (or matrix) of X-Y population coordinates (WGS84) in longitude (degrees West) and latitude (degrees North).
random_seed
Number to seed the random number generation for stochasticity.
time_steps
Number of simulation time steps.
years_per_step
Number of years per time step.
populations
Number of population cells.
initial_abundance
Array (matrix) of initial abundance values at each population cell.
transition_rate
Rate (numeric) of transition between generations at each time-step.
standard_deviation
Standard deviation (numeric) for applying environmental stochasticity to transition rates.
compact_decomposition
List 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_capacity
Array (or matrix) of carrying capacity values at each population cell (across time).
density_dependence
Density dependence type ("competition", "logistic", or "ceiling").
growth_rate_max
Maximum growth rate (utilized by density dependence processes).
dispersal_data
List 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_k
Target population carrying capacity threshold for density dependent dispersal.
harvest
Boolean for utilizing harvesting.
harvest_max
Proportion harvested per year (annual time scale - not generational).
harvest_g
The "G" parameter in the harvest function.
harvest_z
The "Z" parameter in the harvest function.
harvest_max_n
Maximum density per grid cell.
human_density
Matrix of human density (fraction) ($populations rows by $time_steps columns).
abundance_threshold
Abundance threshold (that needs to be exceeded) for each population to persist.
occupancy_threshold
Threshold for the number of populations occupied (that needs to be exceeded) for all populations to persist.
results_selection
List of results selection from ("abundance", "ema", "extirpation", "harvested", "occupancy", "human_density").
attribute_aliases
A list of alternative alias names for model attributes (form: alias = "attribute"
) to be used with the set and get attributes methods.
template_model
Nested template model for fixed (non-sampled) attributes for shallow cloning.
sample_attributes
Vector of sample attribute names (only).
required_attributes
Vector of required attribute names (only), i.e. those needed to run a simulation.
error_messages
A vector of error messages encountered when setting model attributes.
warning_messages
A 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)
params
Optional 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)
deep
Whether 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.