simulate

package
v0.0.0-...-8e46452 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2024 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package simulate creates random trees.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BirthDeath

func BirthDeath(name string, spRate, extRate float64, rootAge int64, terms int) (*timetree.Tree, bool)

BirthDeath create a birth-death tree with the given speciation and extinction rate, in million years, stopping when the number of terminals is reached of when all proposed events are in the future. It returns false if less than two terminals are included. BirthDeath panics if terms < 2.

func Coalescent

func Coalescent(name string, n float64, max int64, terms int) *timetree.Tree

Coalescent creates a random tree using the Kingman coalescence with a population size of n. see Felsenstein J. (2004) "Inferring Phylogenies", Sinauer, p.456. Coalescent panics if terms < 2.

func Uniform

func Uniform(name string, max, min int64, ages []int64) *timetree.Tree

Uniform creates a random tree using a uniform prior based on the method described by Ronquist et al. (2012) "A total evidence approach to dating with fossils, applied to the early radiation of Hymenoptera" Syst. Biol. 61: 973-999. doi:10.1093/sysbio/sys058. Uniform panics if len(ages) < 2,

func Yule

func Yule(name string, spRate float64, rootAge int64, terms int) (*timetree.Tree, bool)

Yule creates a Yule tree with the given speciation rate, in million years, stopping when the number of terminals is reached or when all proposed speciation events are in the future. It returns false if less than two terminals are included. Yule panics if terms < 2.

Types

type Rander

type Rander interface {
	Rand() float64
}

Rander is a distribution that returns a random number.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL