Extract the indices for the ML states at each node, given a row of relative probabilities

Share:

Description

Given a table with the rows representing nodes, and the columns representing the relative probabilities of each state, this function finds the ML (maximum likelihood) state(s) for each node; get_ML_state_indices does this for a row, get_ML_states iterates over all the rows.

Usage

1
2
  get_ML_state_indices(relprobs_row, nums, maxprob,
    if_ties = "takefirst")

Arguments

relprobs_row

A row from a relprobs, a numeric matrix of relative probabilities

nums

Numbers indexing the states from 1 to numstates

maxprob

The value of the maximum probability for the row.

if_ties

What to do with ties. Currently, the only option is to take the first (this will be shown in e.g. a pie chart, of course).

Value

index_of_ML_state_s

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/

Matzke_2012_IBS

See Also

get_ML_states

Examples

1
testval=1

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.