add.OU.curves {paleoTS}R Documentation

Adds curves to an existing plot indicating best-fit OU model

Description

This function takes the results of fitting the Orstein-Uhlenbeck (OU) model and plots the expected value (mean) and 95 percent probability interval of the best-fitting OU parameters.

Usage

add.OU.curves(w, x, what = c("lines", "polygon"), tt.offset = 0, ...)

Arguments

w output from the function opt.alt.OU
x a paleoTS pbject
what whether to draw lines or polygon for the model fit
tt.offset difference between starting age in w and x
... additional arguments to graphing functions

Details

Note that tt.offset is only used in the relatively rare instances in which the model fit is not applied to the entire sequence.

Value

None, the function is evoked to add graphics to an existing plot.

Author(s)

Gene Hunt

See Also

plot.paleoTS, opt.joint.OU

Examples

data(dorsal.spines)
# get subset of samples from invading lineage (tt>=4.5 Kyr), only those with nn>=5
ok<- dorsal.spines$tt >= 4.5 & dorsal.spines$nn >=5
ds2<- sub.paleoTS(dorsal.spines, ok=ok)

# convert time scale to generations (500 gen per Kyr)
ds2$tt<- ds2$tt*(1000/2)	
plot(ds2, pool=TRUE)

# fit OU model
m.ou<- opt.joint.OU(ds2, pool=TRUE)
add.OU.curves(m.ou, ds2, what="lines", col="darkgrey")


[Package paleoTS version 0.3-1 Index]