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)

Arguments

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.

Value

An exponential decay function

Details

The function computes: $$e^{- \frac{d^{s}}{t}}$$ where d is the genetic distance between taxa

Examples

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]]