symbolic_cell_to_relprob_cell_sp: Convert symbolic cell (a text equation) to relprob cell (a...

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

View source: R/BioGeoBEARS_basics_v1.R

Description

This does the equivalent of symbolic_to_P_matrix, but for a speciation/cladogenesis matrix.

Usage

1
2
3
4
5
6
  symbolic_cell_to_relprob_cell_sp(charcell,
    cellsplit = "\\+", mergesym = "*", ys = 1, j = 0,
    v = 1,
    relprob_subsets_matrix = relative_probabilities_of_subsets(6, 1e-04),
    relprob_vicar_matrix = relative_probabilities_of_vicariants(6, 1e-04),
    ...)

Arguments

charcell

The text formula.

cellsplit

The symbol to split the formulas on. Default "\\+" (plus symbol, with escape code).

mergesym

The symbol to merge the formulas with. Default "+".

ys

Relative weight of fully sympatric speciation (range-copying) and sympatric "subset" speciation. Default s=1 mimics LAGRANGE model.

v

Relative weight of vicariant speciation. Default v=1 mimics LAGRANGE model.

j

Relative weight of "founder event speciation"/jump speciation. Default j=0 mimics LAGRANGE model.

relprob_subsets_matrix

A numeric matrix describing the relative probability of each smaller daughter range, conditional on the ancestral rangesize.

relprob_vicar_matrix

A numeric matrix describing the relative probability of each smaller daughter range, conditional on the ancestral rangesize.

...

Additional arguments to pass to relative_probabilities_of_subsets and relative_probabilities_of_vicariants, and thence to strsplit.

Details

These are 1-event probability matrices, not instantaneous rate matrices.

This function can be used in sapply. It still will not be very fast compared to the calculations in cladoRcpp, but can be useful for demonstrative purposes.

Value

cellval The output cell value.

Note

Go BEARS!

Author(s)

Nicholas J. Matzke matzke@berkeley.edu

References

http://phylo.wikidot.com/matzke-2013-international-biogeography-society-poster

Matzke_2012_IBS

See Also

symbolic_to_relprob_matrix_sp, make_relprob_matrix_de

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
testval=1

charcell = "y1"
symbolic_cell_to_relprob_cell_sp(charcell, cellsplit="\\\\+", mergesym="*", ys=1,
j=0, v=1, relprob_subsets_matrix=relative_probabilities_of_subsets(max_numareas=3,
maxent_constraint_01=0.0001),
relprob_vicar_matrix=relative_probabilities_of_vicariants(max_numareas=3,
maxent_constraint_01v=0.0001))

charcell = "y1"
symbolic_cell_to_relprob_cell_sp(charcell, cellsplit="\\\\+", mergesym="*", ys=1,
j=1, v=1, relprob_subsets_matrix=relative_probabilities_of_subsets(max_numareas=3,
maxent_constraint_01=0.0001),
relprob_vicar_matrix=relative_probabilities_of_vicariants(max_numareas=3,
maxent_constraint_01v=0.0001))

charcell = "j"
symbolic_cell_to_relprob_cell_sp(charcell, cellsplit="\\\\+", mergesym="*", ys=1,
j=0, v=1, relprob_subsets_matrix=relative_probabilities_of_subsets(max_numareas=3,
maxent_constraint_01=0.0001),
relprob_vicar_matrix=relative_probabilities_of_vicariants(max_numareas=3,
maxent_constraint_01v=0.0001))

charcell = "j"
symbolic_cell_to_relprob_cell_sp(charcell, cellsplit="\\\\+", mergesym="*", ys=1,
j=1, v=1, relprob_subsets_matrix=relative_probabilities_of_subsets(max_numareas=3,
maxent_constraint_01=0.0001),
relprob_vicar_matrix=relative_probabilities_of_vicariants(max_numareas=3,
maxent_constraint_01v=0.0001))

charcell = "v1_2"
symbolic_cell_to_relprob_cell_sp(charcell, cellsplit="\\\\+", mergesym="*", ys=1,
j=0, v=1, relprob_subsets_matrix=relative_probabilities_of_subsets(max_numareas=3,
maxent_constraint_01=0.0001),
relprob_vicar_matrix=relative_probabilities_of_vicariants(max_numareas=3,
maxent_constraint_01v=0.0001))

charcell = "v1_2"
symbolic_cell_to_relprob_cell_sp(charcell, cellsplit="\\\\+", mergesym="*", ys=1,
 j=1, v=1, relprob_subsets_matrix=relative_probabilities_of_subsets(max_numareas=3,
maxent_constraint_01=0.0001),
relprob_vicar_matrix=relative_probabilities_of_vicariants(max_numareas=3,
maxent_constraint_01v=0.0001))

charcell = "s1_2"
symbolic_cell_to_relprob_cell_sp(charcell, cellsplit="\\\\+", mergesym="*", ys=1,
j=0, v=1, relprob_subsets_matrix=relative_probabilities_of_subsets(max_numareas=3,
maxent_constraint_01=0.0001),
relprob_vicar_matrix=relative_probabilities_of_vicariants(
max_numareas=3,
maxent_constraint_01v=0.0001))

charcell = "s1_2"
symbolic_cell_to_relprob_cell_sp(charcell, cellsplit="\\\\+", mergesym="*",
ys=1, j=1, v=1, relprob_subsets_matrix=relative_probabilities_of_subsets(
max_numareas=3, maxent_constraint_01=0.0001),
relprob_vicar_matrix=relative_probabilities_of_vicariants(
max_numareas=3,
maxent_constraint_01v=0.0001))

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