fit.sgs: Fit a model of trait evolution with a protracted punctuation.

View source: R/complexModels.R

fit.sgsR Documentation

Fit a model of trait evolution with a protracted punctuation.

Description

This function fits a model of punctuated change that is is protracted enough that it is captured by multiple transitional populations. Trait evolution starts in stasis, shifts to a general random walk, and then shifts back into stasis.

Usage

fit.sgs(
  y,
  minb = 7,
  oshare = TRUE,
  pool = TRUE,
  silent = FALSE,
  hess = FALSE,
  meth = "L-BFGS-B",
  model = "GRW"
)

Arguments

y

a paleoTS object

minb

minimum number of populations within each segment

oshare

logical, if TRUE, variance assumed to be shared (equal) across segments

pool

if TRUE, sample variances are substituted with their pooled estimate

silent

logical, if TRUE, progress updates are suppressed

hess

if TRUE, standard errors computed from the Hessian matrix are returned

meth

optimization method, passes to optim

model

type of random walk: "URW", unbiased random walk, or "GRW", a general (directional) random walk

Value

a paleoTSfit object

See Also

fitGpunc

Examples

x <- sim.sgs(ns = c(10, 10, 10))  # default values OK
w <- fit.sgs(x, minb = 8)  # increase minb so example takes less time; not recommended!
plot(x)
abline(v = c(16, 31), lwd = 3)  # actual shifts
abline(v = c(w$parameters[6:7]), lwd = 2, lty = 3, col = "red")  # inferred shifts

paleoTS documentation built on Sept. 11, 2024, 9:18 p.m.