Learn R Programming

paleoTS (version 0.3-1)

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 list including:
  • valuethe log-likelihood of the optimal solution
  • parparameter estimates
  • Knumber of parameters in the model
  • nthe number of observations, equal to the number of evoltuionary transistions
  • shift.startthe index of the initial samples of each segment
  • AICAkaike information criterion
  • AICcmodified Akaike information criterion
  • BICBayes (or Schwarz) information criterion
  • shift.startindex of each sample that starts a new segment
  • all.logllog-likelihoods for all tested partitions of the series into segments
  • GGmatrix of indices of initial samples of each tested segment configuration; each column of GG corresponds to the elements of all.logl

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. Paleobiology32:578--601. Hunt, G. 2008. Gradual or pulsed evolution: when should punctuational explanations be preferred? Paleobiology34:In press.

See Also

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

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$shift.start)  # estimated first sample in second segment

Run the code above in your browser using DataLab