calc_loglike_sp.
calc_loglike_sp_prebyte(tip_condlikes_of_data_on_each_state, phy, Qmat, spPmat = NULL, min_branchlength = 1e-21, return_what = "loglike", probs_of_states_at_root = NULL, rootedge = FALSE, sparse = FALSE, printlevel = 1, use_cpp = TRUE, input_is_COO = FALSE, spPmat_inputs = NULL, cppSpMethod = 3, cluster_already_open = NULL, calc_ancprobs = FALSE, null_range_allowed = TRUE, fixnode = NULL, fixlikes = NULL, stratified = FALSE, states_allowed_TF = NULL)input_is_COO.NULL; users should
usually use spPmat_inputs. spPmat is A
numeric matrix representing the probability of each
ancestor range-->(Left range, Right range) transition at
cladogenesis events. There are different ways to
represent this matrix. In the simplest representation,
this is just a rectangular matrix with numstates rows
(representing the ancestral states) and numstates^2
columns (representing all possible descendant pairs).
Use of this type of matrix is specified by
cppSpMethod=1. It is calculated from a textual
speciation matrix (typically spmat in the code)
via symbolic_to_relprob_matrix_sp. However,
this matrix gets huge and slow for large numbers of
states/ranges. cppSpMethod=2 and
cppSpMethod=3 implement successively more
efficient and faster representation and processing of
this matrix in COO-like formats. See
rcpp_calc_anclikes_sp_COOprobs
for the cppSpMethod=2 method, and
rcpp_calc_anclikes_sp_COOweights_faster
for the cppSpMethod=3 method (the fastest).NULL, effectively means an equal probability for
each state (this is also what LAGRANGE assumes;
and running with NULL will reproduce exactly the
LAGRANGE parameter inferences and
log-likelihood).FALSE.mat2coo) if necessary according
to the input_is_COO parameter.cladoRcpp be used to speed up
calculations? Default TRUE.TRUE) or a standard dense
matrix (FALSE). Default FALSE.spPmat (the speciation transition probability
matrix) can be calculated on-the-fly, according to the
method in cppSpMethod. See example.spPmat_inputs is given, the program
will generate the appropriate spPmat on-the-fly, and the
user does not have to input the full spPmat
manually.cluster_already_open =
makeCluster(rep("localhost",num_cores_to_use), type =
"SOCK"). Note: this will work on most platforms,
including Macs running R from command line, but will NOT
work on Macs running the R GUI R.app, because
parallel processing functions like MakeCluster
from e.g. library(parallel) for some reason crash
R.app. The program runs a check for R.app and will just
run on 1 node if found.NULL which means
running on a single processor.return_what.
rexpokit function
expokit_dgpadm_Qmat. It is also
possible to byte-compile everything during package
installation (via ByteCompile: true in the
DESCRIPTION file), which is implemented in
BioGeoBEARS, so this may be redundant. calc_loglike_sp_prebyte gets byte-compiled
into calc_loglike_sp.
See http://dirk.eddelbuettel.com/blog/2011/04/12/
for discussion of the compile
package.
ReeSmith2008
Landis_Matzke_etal_2013_BayArea
calc_loglike_sp,
rcpp_calc_anclikes_sp,
rcpp_calc_anclikes_sp_COOprobs,
rcpp_calc_anclikes_sp_COOweights_faster,
mat2coo,
rcpp_calc_anclikes_sp_COOweights_faster