Description Usage Arguments Details Value Note Author(s) References See Also Examples
View source: R/BioGeoBEARS_detection_v1.R
This function calculates P(data|range,dp), i.e. the
probability of some detection and taphonomic control
counts, given the true geographic range/state, and
dp
, a detection probability (and, optionally, a
false detection probability, fdp
).
1 2 3 | prob_of_states_from_prior_prob_areas(states_list_0based_index,
numareas = NULL, prior_prob_presence = 0.01,
null_range_gets_0_prob = TRUE, normalize_probs = TRUE)
|
states_list_0based_index |
A states_list, 0-based,
e.g. from
|
numareas |
The number of areas being considered in
the analysis. If |
prior_prob_presence |
The prior probability of presence, i.e. when no detection or taphonomic control data whatsoever is available. Default is set to 0.01 which expresses my totally uninformed bias that in whatever your data is, your species of interest probably doesn't live in the typical area you are looking at. |
null_range_gets_0_prob |
If |
normalize_probs |
If |
This function performs the operation for all states/ranges for all tips.
The idea of taphonomic controls dates back at least to work of Bottjer & Jablonski (1988). The basic idea is that if you have taxa of roughly similar detectability, then detections of other taxa give some idea of overall detection effort. Obviously this is a very simple model that can be criticized in any number of ways (different alpha diversity in each region, different detectability of individual taxa, etc.), but it is a useful starting point as there has been no implementation of any detection model in historical/phylogenetic biogeography to date.
One could imagine (a) every OTU and area has a different count of detections and taphonomic control detections, or (b) the taphonomic control detections are specified by area, and shared across all OTUs. Situation (b) is likely more common, but this function assumes (a) as this is the more thorough case. Behavior (b) could be reproduced by summing each column, and/or copying this sum to all cells for a particular area.
prob_of_each_range
The probability of each range,
given the prior probability of presence in each area.
Go BEARS!
Nicholas J. Matzke matzke@berkeley.edu
http://phylo.wikidot.com/matzke-2013-international-biogeography-society-poster
Matzke_2012_IBS
Bottjer_Jablonski_1988
rcpp_areas_list_to_states_list
,
Pdata_given_rangerow
,
calc_obs_like
, mapply
,
read_detections
,
read_controls
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 | testval=1
prior_prob_presence = 0.01
areas = c("K", "O", "M", "H")
numareas = length(areas)
states_list_0based_index =
rcpp_areas_list_to_states_list(areas=areas, maxareas=4, include_null_range=TRUE)
states_list_0based_index
numareas = 4
mean_frequency=0.1
dp=1
fdp=0
prob_of_states_from_prior_prob_areas(states_list_0based_index, numareas=numareas,
prior_prob_presence=prior_prob_presence, null_range_gets_0_prob=TRUE,
normalize_probs=TRUE)
prob_of_states_from_prior_prob_areas(states_list_0based_index, numareas=numareas,
prior_prob_presence=prior_prob_presence, null_range_gets_0_prob=TRUE,
normalize_probs=FALSE)
prob_of_states_from_prior_prob_areas(states_list_0based_index, numareas=numareas,
prior_prob_presence=prior_prob_presence, null_range_gets_0_prob=FALSE,
normalize_probs=TRUE)
prob_of_states_from_prior_prob_areas(states_list_0based_index, numareas=numareas,
prior_prob_presence=prior_prob_presence, null_range_gets_0_prob=FALSE,
normalize_probs=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.