Skip to contents

Simulates stasis as independent, normally distributed random variables with mean mean and standard deviation sd

Usage

stasis(t, mean = 0, sd = 1)

Arguments

t

times at which the traits are determined

mean

scalar, mean trait value

sd

strictly positive scalar, standard deviation of traits

Value

A list with two elements: t and y. t is a duplicate of the input t, y are the corresponding trait values. Output list is of S3 class timelist (inherits from list) and can thus be plotted directly using plot, see ?admtools::plot.timelist

Examples


 library("admtools") # required for plotting of results
 t = seq(0, 1, by = 0.01)
 l = stasis(t)
 plot(l, type = "l") # plot lineage
 l2 = stasis(t, mean = 0.5, sd = 0.3) # simulate second lineage
 lines(l2$t, l2$y, col = "red") # plot second lineage