make.stepwise: Make a stepwise decay function

View source: R/make.functions.R

make.stepwiseR Documentation

Make a stepwise decay function

Description

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

Usage

make.stepwise(probs, distances)

Arguments

probs

Vector of dimension k, where k is the number of different probabilities of success. An individual time between (distances[i-1],distances[i]] has probability of success prob[i]

distances

Vector of k, containing the end of each interval where success probabilities shift. The first interval where success is prob[1] is [0,distances[1]]. For all i>1, the probability of success is prob[i] over the interval (distance[i-1],distances[i]].

Value

An stepwise decay function

Examples

set.seed(17)
dist_func<- make.stepwise(probs=c(1,0.5,0),distances=c(0.25,0.5,Inf))
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.