opt.punc: Fit a model of trait evolution with specified punctuation(s)

View source: R/complexModels.R

opt.puncR Documentation

Fit a model of trait evolution with specified punctuation(s)

Description

Fit a model of trait evolution with specified punctuation(s)

Usage

opt.punc(
  y,
  gg,
  pool = TRUE,
  cl = list(fnscale = -1),
  meth = "L-BFGS-B",
  hess = FALSE,
  oshare
)

opt.joint.punc(
  y,
  gg,
  pool = TRUE,
  cl = list(fnscale = -1),
  meth = "L-BFGS-B",
  hess = FALSE,
  oshare
)

Arguments

y

a paleoTS object

gg

vector of indices indicating different segments

pool

if TRUE, sample variances are substituted with their pooled estimate

cl

optional control list, passed to optim()

meth

optimization algorithm, passed to optim()

hess

if TRUE, return standard errors of parameter estimates from the

oshare

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

Details

The sequence is divided into segments, which are separated by punctuations. Means for each segment are given by the vector theta with variances given by the vector omega (or a single value if oshare = TRUE). This function calls optim to numerically fit this model to a time-series, y.

Value

a paleoTSfit object with the results of the model fitting

Functions

  • opt.joint.punc(): fits the punctuation model using the joint parameterization

Note

These functions would be used in the uncommon situation in which there is a prior hypothesis as to where the punctuation(s) take place. Normally users will instead use the function fitGpunc, which uses these functions to fit a range of possible timings for the punctuations.

See Also

fitGpunc

Examples

x <- sim.punc(ns = c(15, 15), theta = c(0,3), omega = c(0.1, 0.1))
w.sta  <- fitSimple(x, model = "Stasis", method = "Joint")
w.punc <- opt.joint.punc(x, gg = rep(1:2, each = 15), oshare = TRUE)
compareModels(w.sta, w.punc)

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