View source: R/make.functions.R
make.polynomial.decay | R Documentation |
Create a polynomial decay function for genetic distance of two taxa and the probability of success of a hybridization event
make.polynomial.decay(threshold, degree = 1)
threshold |
A numeric denoting how quickly the polynomial function decays. Distances greater than the threshold will return a success probability of 0. |
degree |
The degree of the polynomial |
The function computes:
1- {\frac{d}{t}}^degree
Where d is the distance and t is the threshold
An polynomial decay function
set.seed(17)
dist_func<- make.polynomial.decay(0.5,2)
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.