# sfunc: Extract the appropriate probability for a subset speciation... In BioGeoBEARS: BioGeography with Bayesian (and Likelihood) Evolutionary Analysis in R Scripts

## Description

Extract the appropriate probability for a subset speciation event, given text code for rangesize of smaller descendant, and ancestor

## Usage

 `1` ``` sfunc(charcell, relprob_subsets_matrix) ```

## Arguments

 `charcell` The text in the cell, indicating the type of speciation/cladogenesis range inheritance event. `relprob_subsets_matrix` A numeric matrix describing the relative probability of each smaller daughter range, conditional on the ancestral rangesize.

## Value

`prob_of_this_b`, a numeric value giving the relative probability of that descendent-ancestor rangesize pair.

Go BEARS!

## Author(s)

Nicholas J. Matzke matzke@berkeley.edu

## References

Matzke_2012_IBS

Harte2011

ReeSmith2008

Ronquist1996_DIVA

Ronquist_1997_DIVA

Ronquist_Sanmartin_2011

Landis_Matzke_etal_2013_BayArea

`yfunc`, `vfunc`, `relative_probabilities_of_subsets`, `symbolic_to_relprob_matrix_sp`, `get_probvals`, `maxent`, `calcZ_part`, `calcP_n`
 ``` 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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95``` ```testval=1 # Examples # Probabilities of different descendant rangesizes, for the smaller descendant, # under sympatric/subset speciation # (plus sympatric/range-copying, which is folded in): relprob_subsets_matrix = relative_probabilities_of_subsets(max_numareas=6, maxent_constraint_01=0.0001, NA_val=NA) relprob_subsets_matrix sfunc(charcell="s1_1", relprob_subsets_matrix) sfunc(charcell="s1_2", relprob_subsets_matrix) sfunc(charcell="s1_3", relprob_subsets_matrix) sfunc(charcell="s2_3", relprob_subsets_matrix) relprob_subsets_matrix = relative_probabilities_of_subsets(max_numareas=6, maxent_constraint_01=0.5, NA_val=NA) relprob_subsets_matrix sfunc(charcell="s1_1", relprob_subsets_matrix) sfunc(charcell="s1_2", relprob_subsets_matrix) sfunc(charcell="s1_3", relprob_subsets_matrix) sfunc(charcell="s2_3", relprob_subsets_matrix) relprob_subsets_matrix = relative_probabilities_of_subsets(max_numareas=6, maxent_constraint_01=0.9999, NA_val=NA) relprob_subsets_matrix sfunc(charcell="s1_1", relprob_subsets_matrix) sfunc(charcell="s1_2", relprob_subsets_matrix) sfunc(charcell="s1_3", relprob_subsets_matrix) sfunc(charcell="s2_3", relprob_subsets_matrix) relprob_subsets_matrix = relative_probabilities_of_subsets(max_numareas=6, maxent_constraint_01=0.0001, NA_val=NA) relprob_subsets_matrix yfunc(charcell="y1", relprob_subsets_matrix) yfunc(charcell="y2", relprob_subsets_matrix) yfunc(charcell="y3", relprob_subsets_matrix) yfunc(charcell="y4", relprob_subsets_matrix) relprob_subsets_matrix = relative_probabilities_of_subsets(max_numareas=6, maxent_constraint_01=0.5, NA_val=NA) relprob_subsets_matrix yfunc(charcell="y1", relprob_subsets_matrix) yfunc(charcell="y2", relprob_subsets_matrix) yfunc(charcell="y3", relprob_subsets_matrix) yfunc(charcell="y4", relprob_subsets_matrix) relprob_subsets_matrix = relative_probabilities_of_subsets(max_numareas=6, maxent_constraint_01=0.9999, NA_val=NA) relprob_subsets_matrix yfunc(charcell="y1", relprob_subsets_matrix) yfunc(charcell="y2", relprob_subsets_matrix) yfunc(charcell="y3", relprob_subsets_matrix) yfunc(charcell="y4", relprob_subsets_matrix) # Probabilities of different descendant rangesizes, for the smaller descendant, # under vicariant speciation relprob_subsets_matrix = relative_probabilities_of_vicariants(max_numareas=6, maxent_constraint_01v=0.0001, NA_val=NA) relprob_subsets_matrix vfunc(charcell="v1_1", relprob_subsets_matrix) vfunc(charcell="v1_2", relprob_subsets_matrix) vfunc(charcell="v1_3", relprob_subsets_matrix) vfunc(charcell="v1_4", relprob_subsets_matrix) vfunc(charcell="v2_4", relprob_subsets_matrix) vfunc(charcell="v2_2", relprob_subsets_matrix) vfunc(charcell="v1_6", relprob_subsets_matrix) vfunc(charcell="v2_6", relprob_subsets_matrix) vfunc(charcell="v3_6", relprob_subsets_matrix) relprob_subsets_matrix = relative_probabilities_of_vicariants(max_numareas=6, maxent_constraint_01v=0.5, NA_val=NA) relprob_subsets_matrix vfunc(charcell="v1_1", relprob_subsets_matrix) vfunc(charcell="v1_2", relprob_subsets_matrix) vfunc(charcell="v1_3", relprob_subsets_matrix) vfunc(charcell="v1_4", relprob_subsets_matrix) vfunc(charcell="v2_4", relprob_subsets_matrix) vfunc(charcell="v2_2", relprob_subsets_matrix) vfunc(charcell="v1_6", relprob_subsets_matrix) vfunc(charcell="v2_6", relprob_subsets_matrix) vfunc(charcell="v3_6", relprob_subsets_matrix) relprob_subsets_matrix = relative_probabilities_of_vicariants(max_numareas=6, maxent_constraint_01v=0.9999, NA_val=NA) relprob_subsets_matrix vfunc(charcell="v1_1", relprob_subsets_matrix) vfunc(charcell="v1_2", relprob_subsets_matrix) vfunc(charcell="v1_3", relprob_subsets_matrix) vfunc(charcell="v1_4", relprob_subsets_matrix) vfunc(charcell="v2_4", relprob_subsets_matrix) vfunc(charcell="v2_2", relprob_subsets_matrix) vfunc(charcell="v1_6", relprob_subsets_matrix) vfunc(charcell="v2_6", relprob_subsets_matrix) vfunc(charcell="v3_6", relprob_subsets_matrix) ```