diffusion

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package diffusion implements an spherical diffusion approximated using a discrete isolatitude pixelation for a phylogenetic biogeography analysis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetCPU

func SetCPU(cpu int)

SetCPU sets the number of process used for the reconstruction.

Types

type Param

type Param struct {
	// Paleolandscape model
	Landscape *model.TimePix

	// Stage rotation model
	Rot *model.StageRot

	// Distance matrix
	DM *earth.DistMat

	// Pixel priors
	PP pixprob.Pixel

	// Ranges is the collection of terminal ranges
	Ranges *ranges.Collection

	// Length in years of the stem node
	Stem int64

	// Lambda is the concentration parameter per million years
	// in 1/radian units
	Lambda float64
}

Param is a collection of parameters for the initialization of a tree.

type SrcDest

type SrcDest struct {
	// ID of the source pixel
	From int

	// ID of the destination pixel
	To int
}

SrcDest contains the pixels of a particle simulation.

type Tree

type Tree struct {
	// contains filtered or unexported fields
}

A Tree os a phylogenetic tree for biogeography.

func New

func New(t *timetree.Tree, p Param) *Tree

New creates a new tree by copying the indicated source tree.

func (*Tree) Conditional added in v0.2.0

func (t *Tree) Conditional(n int, age int64) map[int]float64

Conditional returns the conditional logLikelihood for a given node at a given age stage (in years). The conditional likelihood is returned as a map of pixels to the logLikelihood of the pixels.

func (*Tree) DownPass added in v0.2.0

func (t *Tree) DownPass() float64

DownPass performs the Felsenstein's pruning algorithm to estimate the likelihood of the data for a tree.

func (*Tree) LogLike

func (t *Tree) LogLike() float64

LogLike returns the logLikelihood of the whole reconstruction in the most basal stem node.

func (*Tree) Name

func (t *Tree) Name() string

Name returns the name of the tree.

func (*Tree) Nodes

func (t *Tree) Nodes() []int

Nodes return an slice with IDs of the nodes of the tree.

func (*Tree) SetConditional added in v0.2.0

func (t *Tree) SetConditional(n int, age int64, logLike map[int]float64)

SetConditional sets the conditional likelihood (in logLike units) of a node at a given time stage.

func (*Tree) Simulate

func (t *Tree) Simulate(particles int)

Simulate performs stochastic mappings for the given number of particles.

func (*Tree) SrcDest

func (t *Tree) SrcDest(n, p int, age int64) SrcDest

SrcDest return the source and destination pixel for a given node, at a given age stage (in years), for a particular simulation.

func (*Tree) Stages

func (t *Tree) Stages(n int) []int64

Stages return age of the stages of a node (i.e., internodes) in years.

Jump to

Keyboard shortcuts

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