getBMRatePrior: Get Brownian Motion Rate Prior

View source: R/getBMRatePrior.R

getBMRatePriorR Documentation

Get Brownian Motion Rate Prior

Description

This function automatically calculates prior distributions for the rate of trait evolution under the Brownian Motion (BM) model on a discrete time-scale, at a given timeStep, in the sense that that variable is used with other TreEvo functions like doRun_prc.

Usage

getBMRatePrior(phy, traits, timeStep, verbose = TRUE)

Arguments

phy

A phylogenetic tree, in package ape's phylo format.

traits

Data matrix with rownames identical to phy@tip.label. If a vector, traits will be coerced to a matrix, with element names as rownames.

timeStep

time in a single iteration of the discrete-time simulation

verbose

If TRUE, gives messages about how the simulation is progessing via message.

Details

Returns a matrix of prior values that can be used in the doRun functions. Builds on functions in phylolm to estimate distribution.

Value

Returns a matrix of prior values

Author(s)

Brian O'Meara and Barb Banbury

Examples


data(simRunExample)

#timeStep = 0.1 -> effectively ~100 steps over the tree length

getBMRatePrior(phy = simPhyExample, traits = simCharExample, 
   timeStep = 0.01, verbose = TRUE)



bomeara/treevo documentation built on Aug. 19, 2023, 6:52 p.m.