View source: R/make.functions.R
make.exp.decay | R Documentation |
Create an exponential decay function for genetic distance of two taxa and the probability of success of a hybridization event
make.exp.decay(t = 1, s = 1)
t |
A numeric representing how quickly the hybridization success decays. Samaller values denote a quicker decay |
s |
A numeric for the power that the genetic distance is raised. |
The function computes:
e^{- \frac{d^{s}}{t}}
where d is the genetic distance between taxa
An exponential decay function
set.seed(17)
dist_func<- make.exp.decay(1,1)
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.