simulate_biogeog_history: Simulate a biogeographical history, given a transition matrix...

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

View source: R/BioGeoBEARS_simulate_v1.R

Description

This function simulates a biogeographical history, given a Q transition matrix, a cladogenesis model giving the relative probability of different range inheritance scenarios, a phylogeny, and a 0-based index value deciding the starting state (which could be randomly generated according to a prior distribution of states).

Usage

1
2
  simulate_biogeog_history(phy, Qmat, COO_probs_columnar,
    index_Qmat_0based_of_starting_state)

Arguments

phy

An R phylo object.

Qmat

A (square, dense) Q transition matrix. Using a sparse matrix would require writing another function.

COO_probs_columnar

A speciation/cladogenesis transition matrix, in COO-like form, as produced by rcpp_calc_anclikes_sp_COOweights_faster.

index_Qmat_0based_of_starting_state

An integer index value, between 0 and (numstates-1), which specifies what state will be the starting point for the simulation.

Value

simulated_states_by_node A numeric matrix, giving the 0-based index of the state at each node and tip in the simulated history. Getting a more detailed history would require a version of stochastic mapping (Huelsenbeck et al. (2003), Bollback (2005), Bollback (2006)), but customized for the nonreversible and cladogenic aspects of biogeographical range evolution models.

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/

Huelsenbeck_etal_2003_stochastic_mapping

Bollback_2005

Bollback_2006_SIMMAP

Matzke_2012_IBS

See Also

rcpp_calc_anclikes_sp_COOweights_faster

Examples

1
testval=1

Example output

Loading required package: rexpokit
Loading required package: cladoRcpp
Loading required package: ape
Loading required package: phylobase

Attaching package: 'phylobase'

The following object is masked from 'package:ape':

    edges

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