fit.sgs {paleoTS}R Documentation

Analyze evolutionary models with well-sampled punctuations

Description

Functions required to fit evolutionary models with sampled puntuations, i.e., where the transitional period is represented by at least several sampled populations.

Usage

fit.sgs(y, minb = 5, oshare = TRUE, pool = TRUE, silent = FALSE, hess = FALSE, meth = "L-BFGS-B", model = "GRW")
opt.sgs(y, gg, cl = list(fnscale = -1), meth = "L-BFGS-B", hess = FALSE, oshare = TRUE, model = "GRW")
logL.sgs(p, y, gg, model = "GRW")
logL.sgs.omega(p, y, gg, model = "GRW")

Arguments

y a paleoTS object
minb the minimum number of samples within a segment to consider
oshare logical, if TRUE, the same variance (omega) is assumed across the starting and ending Stasis segments. If FALSE, separate variances are assumed
pool logical indicating whether to pool variances across samples
silent if TRUE, less information is printed to the screen as the model is fit
hess if TRUE, standard errors are computed from the Hessian matrix
meth optimization method, to be passed to optim
model either GRW or URW, indicating whether evolution during the transitional interval is directional (general random walk) or not (unbiased random walk)
p parameters of the punctuation model for the log-likelihood functions
gg numeric vector indicating membership of each sample in segments 1, 2, .. ng
cl control list to be passed to optim

Details

These functions are used to fit a model with an sampled punctuation. Formally, this is a three-segment model that starts as Stasis, transitions to a punctuation of directional evolution (general random walk) or unconstrained (unbiased random walk). The name comes from an abbreviation of the three modes in the segments: Stasis - General Random Walk - Stasis, bearing in mind that the general random walk can be changed to an unbiased random walk. Users are likely only to use fit.sgs, which will calls the other functions in order to find the best parameter estimates and shift points for the segments.

Value

The log-likelihood functions return the log-likelihood of the model for a given set of parameter values (p), assuming that the periods of Stasis have the same variance (logL.punc.omega) or different variances (logL.punc).

Functions fitGpunc and opt.punc return a list with the following elements:

par parameter estimates
value the log-likelihood of the optimal solution
counts returned by optim
convergence returned by optim
message returned by optim
p0 initial guess for parameter values at start of optimization
K number of parameters in the model
n the number of observations, equal to the number of evoltuionary transistions
AIC Akaike information criterion
AICc modified Akaike information criterion
BIC Bayes (or Schwarz) information criterion
se standard errors for parameter estimates, computed from the curvature of the log-likelihood surface (only if hess = TRUE)
... other output from call to optim
In addition, function fit.sgs also returns the following elements:
shift.start index of each sample that starts a new segment
all.logl log-likelihoods for all tested partitions of the series into segments
GG matrix of indices of initial samples of each tested segment configuration; each column of GG corresponds to the elements of all.logl

Author(s)

Gene Hunt

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.sgs, opt.GRW, fitGpunc

Examples

 x<- sim.sgs(ns=c(15, 10, 15), ms=0.5, vs=0.3)
 plot(x)
 # compare sampled punctuation to uniform models
 w1<- fit.sgs(x, minb=7, model="GRW")
 wu<- fit3models(x, silent=TRUE)
 aa<- akaike.wts(c(w1$AICc, wu$aicc))
 names(aa)[1]<- "Samp.Punc"
 cat("Akaike Weights:\n")
 print(round(aa,5))

[Package paleoTS version 0.3-1 Index]