rcpp_calc_anclikes_sp_rowsums {cladoRcpp}  R Documentation 
This function takes the list of possible states (l), and the parameters of a cladogenesis model (s, v, j, y) (which are the relative weights of each of type of cladogenic range inheritance event) and, for each ancestral state, sums the weights of allowed descendant events. Dividing the weights in each row, by the sum of the weights for that row, provides the absolute probabilities of each transition, conditional on the ancestral state for that row.
rcpp_calc_anclikes_sp_rowsums(Rcpp_leftprobs, Rcpp_rightprobs, l, s = 1,
v = 1, j = 0, y = 1, dmat = NULL, maxent01s = NULL,
maxent01v = NULL, maxent01j = NULL, maxent01y = NULL,
max_minsize_as_function_of_ancsize = NULL, printmat = TRUE)
Rcpp_leftprobs 
Probabilities of the states at the base of the left descendant branch 
Rcpp_rightprobs 
Probabilities of the states at the base of the right descendant branch 
l 
List of state indices (0based) 
s 
Relative weight of sympatric "subset" speciation. Default 
v 
Relative weight of vicariant speciation. Default 
j 
Relative weight of "founder event speciation"/jump speciation. Default 
y 
Relative weight of fully sympatric speciation (rangecopying). Default 
dmat 
If given, a matrix of rank numareas giving multipliers for the probability
of each dispersal event between areas. Default NULL, which sets every cell of the

maxent01s 
Matrix giving the relative weight of each possible descendant rangesize for
the smaller range, for a given ancestral rangesize, for a subsetsympatric speciation event.
Default is 
maxent01v 
Matrix giving the relative weight of each possible descendant rangesize for
the smaller range, for a given ancestral rangesize, for a vicariance speciation event.
Default is 
maxent01j 
Matrix giving the relative weight of each possible descendant rangesize for
the smaller range, for a given ancestral rangesize, for a founderevent speciation event.
Default is 
maxent01y 
Matrix giving the relative weight of each possible descendant rangesize for
the smaller range, for a given ancestral rangesize, for a fullsympatric (rangecopying)
speciation event.
Default is 
max_minsize_as_function_of_ancsize 
If given, any state with a range larger that this value will be given a probability of zero (for the branch with the smaller rangesize). This means that not every possible combination of ranges has to be checked, which can get very slow for large state spaces. 
printmat 
Should the probability matrix output be printed to screen? (useful for debugging, but can be dramatically slow in R.app for some reason for even moderate numbers of states; perhaps overrunning the line length...) 
The inputs Rcpp_leftprobs
and Rcpp_rightprobs
are basically irrelevant here, but
retained for symmetry with the other functions. In effect, this function is identical with
rcpp_calc_anclikes_sp
except that Rcpp_leftprobs
and Rcpp_rightprobs
are arrays of 1s of length(l)
, i.e. length(number_of_states)
.
This function is no longer used in BioGeoBEARS
, but has been retained to enable easy counting of
the number of events. When all nonzeroprobability events are of equal probability (e.g. as in LAGRANGE; Ree & Smith 2008)
the function could be used for normalization, but it is safer to use rcpp_calc_anclikes_sp
or
one of the faster COOlike equivalents.
Rsp_rowsums
A vector of size (numstates) giving the number of events of nonzero probability
for each ancestral states.
Nicholas Matzke matzke@berkeley.edu
rcpp_calc_anclikes_sp
, rcpp_calc_anclikes_sp_COOprobs
,
rcpp_calc_anclikes_sp_COOweights_faster
#bibliography /Dropbox/_njm/__packages/cladoRcpp_setup/cladoRcpp_refs.bib
@cite Matzke_2013
@cite Matzke_2014
@cite ReeSmith2008
# For the basic logic of a probablistic cladogenesis model, see
?rcpp_calc_anclikes_sp
# For examples of running the functions, see the comparison of all functions at:
# ?cladoRcpp