make.exp.decay: Make an exponential decay function

View source: R/make.functions.R

make.exp.decayR Documentation

Make an exponential decay function

Description

Create an exponential decay function for genetic distance of two taxa and the probability of success of a hybridization event

Usage

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.

Details

The function computes:

e^{- \frac{d^{s}}{t}}

where d is the genetic distance between taxa

Value

An exponential decay function

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

jjustison/SiPhyNetwork documentation built on Sept. 14, 2024, 8:58 a.m.