make.polynomial.decay: Make a polynomial decay function

View source: R/make.functions.R

make.polynomial.decayR Documentation

Make a polynomial decay function

Description

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

Usage

make.polynomial.decay(threshold, degree = 1)

Arguments

threshold

A numeric denoting how quickly the polynomial function decays. Distances greater than the threshold will return a success probability of 0.

degree

The degree of the polynomial

Details

The function computes:

1- {\frac{d}{t}}^degree

Where d is the distance and t is the threshold

Value

An polynomial decay function

Examples

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