FPK_sim_traitgram: Simulations with traitgram

Description Usage Arguments Details Value Author(s) See Also

View source: R/FPK_sim_traitgram.R

Description

Simulates a trait evolving according to the FPK model and also plots evolution along branches of this tree using a traitgram.

Usage

1
2
FPK_sim_traitgram(tree, x0, a, b, c, bounds, sigsq, time_step, res.x = 200
  , ylim.plot = NULL, return.trait = FALSE)

Arguments

tree

The phylogenetic tree on which to simulate the trait evolving.

x0

The initial value of the trait (at the root of the tree).

a

The coefficient for the x^4 term of the potential.

b

The coefficient for the quadratic term of the potential.

c

The coefficient for the linear term of the potential.

bounds

The bounds on the trait interval.

sigsq

The evolutionary rate.

time_step

The time step for incremental simulations (should be smaller that the shortest branch in the tree).

res.x

The number of points to use for discretizing the trait interval.

ylim.plot

The y limits of the plot. If left to NULL, the bounds of the trait interval will be used, but you might want to zoom in a bit more if the bounds are not reached.

return.trait

If set to TRUE, the function returns a named vector of trait values at the tips of the tree.

Details

The function is slower than Sim_FPK since it simulates step by step along branches. It should be used to visualize trait evolution, but Sim_FPK should be preferred for quick simulations.

Value

The function is mainly designed to produce a plot, but eventually returns a named vector of trait values at the tips of the tree.

Author(s)

F. C. Boucher

See Also

Sim_FPK


BBMV documentation built on May 1, 2019, 10:26 p.m.