create.dispersal.matrix: Create dispersal matrix

Description Usage Arguments Details Value Examples

Description

Functions to create dispersal matrices

Usage

1
2

Arguments

x

A matrix of 2D (n-D) points with row denoting points, first column x/longitude, second column y/latitude (or a Spatial object that has a coordinates method).

a

Parameter of the Laplacian dispersal function. 1/a is the mean dispersal distance.

longlat

It defines how coordinates in x are used to calculate spatial distances. If longlat = FALSE, Euclidean distance; if TRUE, Great Circle distance.

n

Number of demes

m

Migration probability

Details

create.dispersal.coord creates a dispersal matrix based on spatial distance between demes, using a Laplacian dispersal function:
p(i,j) = 0.5 * a * exp(-a*dist(i,j)),
where dist(i,j) is the spatial distance between deme i and deme j and 1/a is the mean dispersal distance.

create.dispersal.IM creates a dispersal matrix based on an island model. The probability to disperse to any n-1 non-natal patch is m/(n-1) while the probability to stay in the natal patch is 1-m.

Value

A square symmetric matrix whose [i,j] element gives the probability of dispersal from deme j to deme i.

Examples

1
2
3
4
lon <- c(12.3, 13.3, 14.2, 16.9, 16.1, 17.5, 18.1, 19.7, 20.3)
lat <- c(45.4, 46.5, 48.9, 47.1, 45.8, 46.1, 47.0, 46.8, 47.2)
x <- cbind(lon,lat)
create.dispersal.coord(x,0.01,longlat=T)

MarcoAndrello/MetaPopGen-2.0 documentation built on Nov. 25, 2020, 11:20 p.m.