tipranges_to_tip_condlikes_of_data_on_each_state: Convert a tipranges object to the tip likelihoods

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

View source: R/BioGeoBEARS_basics_v1.R

Description

This function takes a tipranges object, and converts it to tip likelihoods for input into the likelihood calculations of calc_loglike_sp.

Usage

1
2
3

Arguments

tipranges

An object of class tipranges.

phy

A phylogenetic tree (ape object of class phylo)

states_list

A complete list of the different states, of class list form

maxareas

The maximum number of areas in a geographic range, if the user does

Details

This (like LAGRANGE (Ree et al. (2008)) and every other available program) assumes that the geographic ranges at the tips are known with certainty. Reality may be different, particularly for sparsely-studied, scarce, or fossil taxa. In such a case, a detection model is needed to specify the likelihood of the observation data under each possible geographic range at the tips.

Note that data likelihoods under this or that hypothesis are not the same thing as probabilities. E.g., with DNA, if sequencing machine says that the base could be either A or C, but not G or T, then the likelihood of the data for that nucleotide position for that species would be 1 1 0 0, not 0.5 0.5 0 0. See Felsenstein (2004), p. 255, for more.

Value

tip_condlikes_of_data_on_each_state For each tip/row, likelihood of that tip's data under each possible true geographic range (columns)

Note

Go BEARS!

Author(s)

Nicholas J. Matzke matzke@berkeley.edu

References

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

ReeSmith2008

Matzke_2012_IBS

Felsenstein2004

See Also

define_tipranges_object, getareas_from_tipranges_object, areas_list_to_states_list_new, areas_list_to_states_list_old, binary_ranges_to_letter_codes

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
testval=1
# Define a tipranges object
tipranges_object = define_tipranges_object()
tipranges_object

areanames = getareas_from_tipranges_object(tipranges_object)
areanames

# Specify phylogeny to go with default tipranges object
newick_str = "((tip1:1,tip2:1):1,tip3:2):1;"
phy = read.tree(file="", text=newick_str)

# Here, we will assume the maximum range size is all areas, but it could be smaller
maxareas = length(areanames)
## Not run: 
states_list = areas_list_to_states_list_old(areas=areanames, include_null_range=TRUE,
maxareas=maxareas)
states_list

## End(Not run)

states_list = areas_list_to_states_list_new(areas=areanames, include_null_range=TRUE,
maxareas=maxareas)
states_list

tip_condlikes_of_data_on_each_state = tipranges_to_tip_condlikes_of_data_on_each_state(
tipranges=tipranges_object, phy=phy, states_list=states_list, maxareas=maxareas )
tip_condlikes_of_data_on_each_state

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