Learn R Programming

paleoTS (version 0.6.2)

opt.ssm.GRW: Fit evolutionary models using state-space models (SSM)

Description

Fit evolutionary models using state-space models (SSM)

Usage

opt.ssm.GRW(y, pool = TRUE, cl = list(fnscale = -1), hess = FALSE)

opt.ssm.URW(y, pool = TRUE, cl = list(fnscale = -1), hess = FALSE)

opt.ssm.Stasis(y, pool = TRUE, cl = list(fnscale = -1), hess = FALSE)

opt.ssm.StrictStasis(y, pool = TRUE, cl = list(fnscale = -1), hess = FALSE)

opt.ssm.OU(y, pool = TRUE, cl = list(fnscale = -1), hess = FALSE)

opt.ssm.ACDC(y, pool = TRUE, cl = list(fnscale = -1), hess = FALSE)

opt.ssm.covOU(y, z, pool = TRUE, cl = list(fnscale = -1), hess = FALSE)

opt.ssm.URWshift(y, gg, pool = TRUE, cl = list(fnscale = -1), hess = FALSE)

opt.ssm.covOU_vshift( y, z, gg, pool = TRUE, cl = list(fnscale = -1), hess = FALSE )

Value

a paleoTSfit object with the model fitting results

Arguments

y

a paleoTS object

pool

if TRUE, sample variances are substituted with their pooled estimate

cl

optional control list, passed to optim()

hess

if TRUE, return standard errors of parameter estimates from the hessian matrix

z

a covariate vector, used only for the covOU models

gg

a grouping vector, used only for the URWshift and covOU_vshift models

Details

These functions use a state space model formulation to compute likelihoods and fit models.

Functions to fit the OU covariate tracking models (covOU, covOU_vshift) require a covariate argument, z. At present, only the OU covariate tracking with a shift in the step variance (covOU_vshift) requires the grouping vector argument (gg).

See Also

fitSimple, opt.joint.GRW

Examples

Run this code
y <- sim.GRW(ns = 30, vs = 2)
w1 <- opt.ssm.URW(y)
gg <- rep(1:2, each = 15) # shift occurs immediately after sample 15
w2 <- opt.ssm.URWshift(y, gg = gg) # test model in which the step variance shifts
compareModels(w1, w2)

Run the code above in your browser using DataLab