make_relprob_matrix_de: Make a relative dispersal probability matrix (in text form)

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/BioGeoBEARS_basics_v1.R

Description

This function takes a list of states/geographic ranges, and makes a relative probability matrix describing the probability of transition between each state. These probabilities are described in terms of d, "dispersal" (actually range expansion) and "extinction" (actually local extirpation, or range contraction), as done in the program LAGRANGE (Ree et al. (2008), Smith et al. (2010)).

Usage

1
2
3
4
5
  make_relprob_matrix_de(states_list = default_states_list(),
    split_ABC = FALSE, split = "",
    remove_simultaneous_events = TRUE,
    add_multiple_Ds = TRUE,
    dispersal_multiplier_matrix = make_dispersal_multiplier_matrix(states_list))

Arguments

states_list

A list of states, where each state consists of a list of areas. A default example list is provided.

split_ABC

TRUE or FALSE If TRUE then each state/range in the input geographic ranges (states_list) will be split on the argument contained in split.

split

The character to split on.

remove_simultaneous_events

If TRUE (default, as in LAGRANGE and almost all phylogenetic Markov models), then it is assumed that all changes in geographic range along branches must happen one event at a time. If FALSE, simultaneous events are not excluded; this is not recommended. However, notably, a commonly-used biogeographic model (treating biogeography as a multistate discrete character in an ML framework, where every species/lineage inhabits one and only one area at any point in time) effectively is invoking a simultaneous event: e.g., A->B is a simultaneous range gain and range loss, from the perspective of the dispersal-extinction framework.

add_multiple_Ds

If TRUE (default, as in LAGRANGE), the probabilities of dispersal from each possible source area are added together.

dispersal_multiplier_matrix

A user-provided dispersal multiplier matrix; the default is a matrix of 1s from make_dispersal_multiplier_matrix(states_list=states_list).

Details

The output data.frame, termed dedf (dedf=dispersal-extinction data.frame), contains the actual text of the formulas by which the transition probability matrix would be calculated. E.g., the example calculates the matrix corresponding to Equation 1 on p. 6 of Ree & Smith (2008).

Note that the geographic range-change process described here is a continuous-time process, where the probability of change is a function of branch length, and all transitions occur because of dispersal and extinction. LAGRANGE also implements a cladogenesis model (thus DEC – dispersal-extinction-cladogenesis) which describes an "instantaneous" process of geographic range change at speciation/lineage-splitting events. BioGeoBEARS allows users to turn on, turn off, or otherwise customize both the continuous-time model and the cladogenesis model.

Value

dedf The output data.frame, termed dedf (dedf=dispersal-extinction data.frame), contains the actual text of the formulas by which the transition probability matrix would be calculated.

Note

Go BEARS!

Author(s)

Nicholas J. Matzke matzke@berkeley.edu

References

http://phylo.wikidot.com/matzke-2013-international-biogeography-society-poster https://code.google.com/p/lagrange/

ReeSmith2008

SmithRee2010_CPPversion

Matzke_2012_IBS

FosterIdiots

See Also

make_dispersal_multiplier_matrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
testval=1

states_list = list("_", c("A"), c("B"), c("C"), c
("A","B"), c("B","C"), c("A","C"), c("A","B","C"))

states_list = areas_list_to_states_list_new(
areas=c("A","B","C"), include_null_range=TRUE, split_ABC=TRUE)
states_list

dedf = make_relprob_matrix_de(states_list=states_list,
split_ABC=FALSE, split="", remove_simultaneous_events=TRUE,
add_multiple_Ds=TRUE,
dispersal_multiplier_matrix=make_dispersal_multiplier_matrix(states_list=states_list))

dedf

Example output

Loading required package: rexpokit
Loading required package: cladoRcpp
Loading required package: ape
Loading required package: phylobase

Attaching package: 'phylobase'

The following object is masked from 'package:ape':

    edges

[[1]]
[1] "_"

[[2]]
[1] "A"

[[3]]
[1] "B"

[[4]]
[1] "C"

[[5]]
[1] "A" "B"

[[6]]
[1] "A" "C"

[[7]]
[1] "B" "C"

[[8]]
[1] "A" "B" "C"

    _ A B C  AB  AC  BC     ABC
_   0 0 0 0   0   0   0       0
A   e - 0 0 1*d 1*d   0       0
B   e 0 - 0 1*d   0 1*d       0
C   e 0 0 -   0 1*d 1*d       0
AB  0 e e 0   -   0   0 1*d+1*d
AC  0 e 0 e   0   -   0 1*d+1*d
BC  0 0 e e   0   0   - 1*d+1*d
ABC 0 0 0 0   e   e   e       -

BioGeoBEARS documentation built on May 29, 2017, 8:36 p.m.