View source: R/make.functions.R
make.stepwise | R Documentation |
Create a stepwise decay function for genetic distance of two taxa and the probability of success of a hybridization event
make.stepwise(probs, distances)
probs |
Vector of dimension k, where k is the number of different probabilities of success. An individual time between (distances[i-1],distances[i]] has probability of success prob[i] |
distances |
Vector of k, containing the end of each interval where success probabilities shift. The first interval where success is prob[1] is [0,distances[1]]. For all i>1, the probability of success is prob[i] over the interval (distance[i-1],distances[i]]. |
An stepwise decay function
set.seed(17)
dist_func<- make.stepwise(probs=c(1,0.5,0),distances=c(0.25,0.5,Inf))
net<-sim.bdh.age(1,1,5,2,2,c(1/3,1/3,1/3),hyb.inher.fxn = make.uniform.draw(),
hyb.rate.fxn=dist_func,complete=TRUE)[[1]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.