Learn R Programming

paleoTS (version 0.4-4)

opt.GRW.shift: Functions for random walks with shifting parameters

Description

Functions to simulate and to infer a model with random walk dynamics, with parameter values that shift at one or more points in the sequence.

Usage

opt.GRW.shift(y, ng = 2, minb = 5, model = 1, pool = TRUE, silent = FALSE)

Arguments

y
a paleoTS object
ng
the number of different segments in the sequence
minb
the minimum number of samples to consider as a segment
model
options for variants of random walk to fit (see Details).
pool
if TRUE, pool phenotypic variances across samples
silent
if TRUE, do not print information on fitting to screen

Value

  • A paleoTSfit object.

Details

This model divides an evolutionary sequence into two or more non-overlapping parts called segments, and then fits some version of the random walk model to each segment separately. The model argument has four options: model=1, general random walk model, step variance shared across segments model=2, general random walk model, step mean shared across segments model=3, unbiased random walk, separate step variance for each segment model=4, general random walk, speparate step mean and variance for each segment

References

Hunt, G. 2006. Fitting and comparing models of phyletic evolution: random walks and beyond. Paleobiology 32:578--601. Hunt, G. 2008. Gradual or pulsed evolution: when should punctuational explanations be preferred? Paleobiology 34:360--377.

See Also

sim.GRW.shift, opt.GRW, opt.RW.Mult, as.paleoTSfit

Examples

Run this code
x<- sim.GRW.shift(ns=c(20,20), ms=c(0,1), vs=c(0.2, 0.2))
 plot(x)
 w.shift<- opt.GRW.shift(x, ng=2, model=1)
 print (w.shift$par)
 print (w.shift$shift1)  # estimated first sample in second segment

Run the code above in your browser using DataLab