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

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

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 ReeSmith2008), 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

See Also

convolve #bibliography /Dropbox/_njm/__packages/cladoRcpp_setup/cladoRcpp_refs.bib @cite Matzke_2013 @cite Matzke_2014 @cite ReeSmith2008

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)

Example output

[1] 7
[1] 8
[1] 7
[1] 4
[1] 128
[1] 29
[1] 256
[1] 37
[1] 1048576
[1] 211
[1] 1351

cladoRcpp documentation built on May 2, 2019, 2:43 a.m.