Title: | a Keep It Simple Species Migration Model |
---|---|
Description: | Simulating species migration and range dynamics under stable or changing environmental conditions based on a simple, raster-based, deterministic or stochastic migration model. Kissmig runs on binary or quantitative suitability maps, which are pre-calculated with niche-based habitat suitability models (also called ecological niche models (ENMs) or species distribution models (SDMs)). Nobis & Normand (2014), <doi:10.1111/ecog.00930>. |
Authors: | Michael P. Nobis [cre, aut], Signe Normand [ctb] |
Maintainer: | Michael P. Nobis <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.0-5 |
Built: | 2025-02-22 03:08:55 UTC |
Source: | https://github.com/cran/kissmig |
kissmig
runs a simple, raster-based, stochastic migration model to simulate species migration and
range shifts. It uses a geographic area of origin along with suitability maps to iteratively run a simple
3x3 cell algorithm. Specifically, it allows for generating accessibility maps for easy integration of limited
migration in species distribution models (Nobis and Normand 2014, <doi:10.1111/ecog.00930>).
kissmig(O, S=NULL, it, type='FOC', signed=FALSE, pext=1.0, pcor=0.2, seed=NULL)
kissmig(O, S=NULL, it, type='FOC', signed=FALSE, pext=1.0, pcor=0.2, seed=NULL)
O |
a single RasterLayer of the geographic origin |
S |
a Raster* object of suitability, i.e., a RasterLayer, RasterStack, or RasterBrick |
it |
number of iteration steps |
type |
type of result: final distribution ('DIS'), iteration step of first occurrence ('FOC'), iteration step of last occurrence ('LOC'), or number of iteration steps with occurrence ('NOC') |
signed |
if TRUE, the sign indicates whether the cells was colonized (positive) or uncolonized (negative) after the last iteration step |
pext |
propability [0,1] a colonized cell becomes uncolonized between iteration steps, i.e., the species gets locally extinct |
pcor |
propability [0,1] corner cells are considered in the 3x3 cell neighborhood |
seed |
integer used to set the seed of the random number generator |
Starting from origin "O" kissmig
simulates migration for "it" iteration steps in a heterogeneous environment
characterised by the suitability layer(s) "S". The colonized cells of the origin "O" have value 1, uncolonized
cells value 0. In case "S" consists of several suitability layers to cover environmental change, "it" is applied to each
layer. Suitability ranges between 0 (unsuitable) and 1 (suitability maximum). kissmig
uses a 3x3 algorithm
for species spread/migration. All cells get exstinct before an iteration step with probability "pext", and for
a recolonization or new colonization event corner cells within the 3x3 neighborhood are considers
with probability "pcor" ("pcor"=0.2 produces more realistic circular spread patterns - see Nobis & Normand 2014).
For runtime optimization, signed results are generate for "signed"=TRUE, i.e, in addtion to
the result type 'FOC, 'LCO', or 'NOC', the sign indicates the final distribution ('DIS') with positive values
beeing colonized and negative values beeing previously colonized but uncolonized after the last iteration step.
To get reproducible results, the seed of the R random number generator can be set using the "seed" parameter.
Nobis MP and Normand S (2014) KISSMig - a simple model for R to account for limited migration in analyses of species distributions. Ecography 37: 1282-1287. <doi:10.1111/ecog.00930>
KISSMig homepage <https://purl.oclc.org/wsl/kissmig>
library(kissmig) # create a suitability map and geographic origin s <- kissmigDummyS(mean=12, sd=3) o <- kissmigOrigin(s, x=8, y=44.5, size=0.5) l <- s>=0 # land mask used for plotting kissmig results below plot(s, asp=1.0, main='suitability + origin (in black)') plot(o, col=c(NA,"black"), legend=FALSE, add=TRUE) # add origin # run kissmig with different type of output k <- kissmig(o, s, it=150, type='FOC') plot(k*l, asp=1.0, main='First iteration step of occurrence (type="FOC")') plot(o, col=c(NA,"black"), legend=FALSE, add=TRUE) # add origin a <- kissmigAccess(k) plot(a*l, asp=1.0, main='Accessibility based on "FOC", absolute values') plot(o, col=c(NA,"black"), legend=FALSE, add=TRUE) # add origin a <- kissmigAccess(k, rel=TRUE) plot(a*l, asp=1.0, main='Accessibility based on "FOC", relative values') plot(o, col=c(NA,"black"), legend=FALSE, add=TRUE) # add origin k <- kissmig(o, s, it=150, type='DIS') plot(k*l, asp=1.0, main='Final distribution (type="DIS")') plot(o, col=c(NA,"black"), legend=FALSE, add=TRUE) # add origin k <- kissmig(o, s, it=150, type='LOC') plot(k*l, asp=1.0, main='Last iteration step of occurrence (type="LOC")') plot(o, col=c(NA,"black"), legend=FALSE, add=TRUE) # add origin k <- kissmig(o, s, it=150, type='NOC') plot(k*l, asp=1.0, main='Number of iteration steps with occurrences (type="NOC")') plot(o, col=c(NA,"black"), legend=FALSE, add=TRUE) # add origin
library(kissmig) # create a suitability map and geographic origin s <- kissmigDummyS(mean=12, sd=3) o <- kissmigOrigin(s, x=8, y=44.5, size=0.5) l <- s>=0 # land mask used for plotting kissmig results below plot(s, asp=1.0, main='suitability + origin (in black)') plot(o, col=c(NA,"black"), legend=FALSE, add=TRUE) # add origin # run kissmig with different type of output k <- kissmig(o, s, it=150, type='FOC') plot(k*l, asp=1.0, main='First iteration step of occurrence (type="FOC")') plot(o, col=c(NA,"black"), legend=FALSE, add=TRUE) # add origin a <- kissmigAccess(k) plot(a*l, asp=1.0, main='Accessibility based on "FOC", absolute values') plot(o, col=c(NA,"black"), legend=FALSE, add=TRUE) # add origin a <- kissmigAccess(k, rel=TRUE) plot(a*l, asp=1.0, main='Accessibility based on "FOC", relative values') plot(o, col=c(NA,"black"), legend=FALSE, add=TRUE) # add origin k <- kissmig(o, s, it=150, type='DIS') plot(k*l, asp=1.0, main='Final distribution (type="DIS")') plot(o, col=c(NA,"black"), legend=FALSE, add=TRUE) # add origin k <- kissmig(o, s, it=150, type='LOC') plot(k*l, asp=1.0, main='Last iteration step of occurrence (type="LOC")') plot(o, col=c(NA,"black"), legend=FALSE, add=TRUE) # add origin k <- kissmig(o, s, it=150, type='NOC') plot(k*l, asp=1.0, main='Number of iteration steps with occurrences (type="NOC")') plot(o, col=c(NA,"black"), legend=FALSE, add=TRUE) # add origin
kissmigAccess
calculates a accessibility map from a kissmig output of first occurrence (type='FOC'). These maps
allows the integration of limited migration in species distribution models and macroecological analyses.
kissmigAccess(grd, rel=FALSE)
kissmigAccess(grd, rel=FALSE)
grd |
a single RasterLayer of first occurrence generated by kissmig |
rel |
if TRUE, kissmigAccess returns relative values with maximum 1, otherwise absolute interger values |
kissmig
maps of first occurrences show values of the first iteration step a raster cell was colonized. Early
colonized cells have low values, late colonized cells high values. These values are the opposite of accessibility,
which is high for early colonized, and low for late colonized cells. kissmigAccess
simply calculates for each
cell the accessibility as the difference between the cell value and max(grd)+1
. Cells which have never been
colonized remain unchanged (value 0).
kissmigDummyS
is a support function to generate simple suitability maps based on mean annual air temperature for example code.
kissmigDummyS(mean, sd)
kissmigDummyS(mean, sd)
mean |
temperature mean (degree celsius) of the suitability distribution |
sd |
temperature standard deviation (degree celsius) of the suitability distribution |
kissmigDummyS
returns a suitability map for a given extent based on mean annual temperature. It uses
data of WorldClim and calculates suitability as a normal distribution defined by mean
and sd
of mean annual temperature. The density function is linearly rescaled to a maximum of 1, the maximum suitability
used in kissmig
.
kissmigOrigin
is a support function to define the geographic origin for a kissmig
call.
kissmigOrigin(grd, x, y, size)
kissmigOrigin(grd, x, y, size)
grd |
a single RasterLayer as reference layer |
x |
lower left x-coordinate of geographic origin |
y |
lower left y-coordinate of geographic origin |
size |
size of the quadratic origin |
kissmigOrigin
returns a rasterLayer characterized by the reference
grd
. Cell values are set to zero, except for cells of the origin defined by
extent(x, x+size, y, y+size)
which are set to one.
Map of the bioclimatic variable BIO1 (annual mean temperature in °C) covering Europe.
wcl_bio1_europe
wcl_bio1_europe
A RasterLayer
object.
The map is based on WorldClim version 2.1 climate data for 1970-2000 and has a spatial resolution of five minutes.
<https://geodata.ucdavis.edu/climate/worldclim/2_1/base/wc2.1_5m_bio.zip>