make.linear.decay {SiPhyNetwork}R 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]]

[Package SiPhyNetwork version 1.1.0 Index]