numstates_from_numareas: Calculate the number of states, given a certain number of...

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

View source: R/cladoRcpp.R

Description

This function calculates the number of discrete states that are needed to represent the possible combinations of presence and absence in a set of discrete areas. The number of states is a function of the number of areas, and the maximum allowed range size (in number of areas) of a species.

Usage

1
2
  numstates_from_numareas(numareas = 3,
    maxareas = numareas, include_null_range = FALSE)

Arguments

numareas

The number of areas in the analysis.

maxareas

The maximum number of areas that any single species/lineage can occupy.

include_null_range

If FALSE (default), the null range is not included in the count. If TRUE, the null range is included, adding +1 to the count of the states.

Details

For example, with 3 areas (A, B, C), there are 8 possible states, if a null range is allowed (null, A, B, C, AB, BC, AC, ABC). If the maximum range size is 2 areas, then there are only 7 possible states.

The formula for the number of geographic states, based on the number of areas (N), is the sum of N choose k, from k=1 to m (maximum range size)

s = sum(k=1...m)(N choose k)

This equation assumes that the null range (a species lives in no areas, i.e. is extinct) is not allowed. In the LAGRANGE program of Ree et al. (2008)), the null range is included in the transition matrix, and thus this is one more state. This situation is represented in numstates_from_numareas by setting include_null_range=TRUE.

Users might manually remove states from the states list, if prior information indicates that some configurations of presence/absence in areas are impossible as geographic ranges for species. If so, they should manually subtract from the number of states.

Value

nstates Number of states

Author(s)

Nicholas Matzke matzke@berkeley.edu

References

Ree RH and Smith SA (2008). "Maximum likelihood inference of geographic range evolution by dispersal, local extinction, and cladogenesis." _Systematic Biology_, *57*(1), pp. 4-14. <URL: http://dx.doi.org/10.1080/10635150701883881>, <URL: http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=18253896>.

Matzke N (2012). "Founder-event speciation in BioGeoBEARS package dramatically improves likelihoods and alters parameter inference in Dispersal-Extinction-Cladogenesis (DEC) analyses." _Frontiers of Biogeography_, *4*(suppl. 1), pp. 210. ISSN 1948-6596, Poster abstract published in the Conference Program and Abstracts of the International Biogeography Society 6th Biannual Meeting, Miami, Florida. Poster Session P10: Historical and Paleo-Biogeography. Poster 129B. January 11, 2013, <URL: http://phylo.wikidot.com/matzke-2013-international-biogeography-society-poster>.

See Also

convolve

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
numstates_from_numareas(numareas=3, maxareas=3,
include_null_range=FALSE)
numstates_from_numareas(numareas=3, maxareas=3,
include_null_range=TRUE)
numstates_from_numareas(numareas=3, maxareas=2,
include_null_range=TRUE)
numstates_from_numareas(numareas=3, maxareas=1,
include_null_range=TRUE)
numstates_from_numareas(numareas=7, maxareas=7,
include_null_range=TRUE)
numstates_from_numareas(numareas=7, maxareas=2,
include_null_range=TRUE)
numstates_from_numareas(numareas=8, maxareas=8,
include_null_range=TRUE)
numstates_from_numareas(numareas=8, maxareas=2,
include_null_range=TRUE)
numstates_from_numareas(numareas=20, maxareas=20,
include_null_range=TRUE)
numstates_from_numareas(numareas=20, maxareas=2,
include_null_range=TRUE)
numstates_from_numareas(numareas=20, maxareas=3,
include_null_range=TRUE)

wrathematics/cladoRcpp documentation built on May 4, 2019, 9:48 a.m.