Learn R Programming

paleoTS (version 0.5-1)

cat.paleoTS: Miscellaneous functions used internally for punctuations

Description

These functions are used internally in the simulation and fitting of models with heterogeneous evolutionary dynamics. They generally will not be used directly by users.

Usage

cat.paleoTS(y)
split4punc(y, gg, overlap=TRUE)
shifts(ns, ng, minb=7)
shift2gg(ss, ns)

Arguments

y

a paleoTS object

gg

a vector of integers from 1 to the number of segments, indicating for each sample, the segment to which it belongs

overlap

if TRUE, the initial sample of each segement starts with the last sample of the previous segment

ns

the number of samples in the entire sequence

ng

the number of 'groups', i.e., independently evolving evolutionary segments

minb

the minimum number of samples to include in a segment

ss

an integer, or vector of integers, indicating the index of the initial sample of segments

Value

Function cat.paleoTS returns a single paleoTS object, and split4punc returns a list of multiple paleoTS objects.

Function shifts returns a matrix of shift points--the index of samples that initiate new segments. This matrix has ng-1 rows, where the ith row corresponds to the index of the initial sample for segment i+1. Each column represents one of the possible shift point combinations. Function shift2gg returns a grouping vector from these initial shift points.

Details

Function cat.paleoTS concatenates a list of multiple paleoTS objects into a single time-series. Note that the ages (tt) of the resulting time-series are read directly from the constituent time-series.

Function split4punc divides a paleoTS time-series into separate component time-series according to the grouping vector gg.

Function shifts returns a matrix of all allowable shift points for dividing ns samples into ng segments, subject to the constraint that each segement has at least minb samples. Function shifts2gg converts a vector of shift points into a grouping vector.

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? Paleobiology 34:360-377.

See Also

fitGpunc, sim.punc, opt.GRW.shift

Examples

Run this code
# NOT RUN {
 # show all possible shift points for 20 samples divided into two semgments 
 # (assuming each has at least 6 samples)
 GG<- shifts(ns=20, ng=2, minb=6)
 print (GG)
 # show resulting grouping vector from first of these
 gg<- shift2gg(GG[,1], ns=20)
 print (gg)
 
# }

Run the code above in your browser using DataLab