make.linear.decay: Make a linear decay function

View source: R/make.functions.R

make.linear.decayR Documentation

Make a linear decay function

Description

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

Usage

make.linear.decay(threshold)

Arguments

threshold

A numeric representing how quickly the hybridization success decays. Smaller values denote a quicker decay

Details

The function computes:

1-\frac{d}{t}

where d is the genetic distance between taxa

Value

A linear decay function

Note

a distance d greater than t will return 0

Examples

set.seed(17)
dist_func<- make.linear.decay(0.5)
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.