opt.ssm.GRW | R Documentation |
Fit evolutionary models using state-space models (SSM)
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
)
y |
a |
pool |
if |
cl |
optional control list, passed to |
hess |
if |
z |
a covariate vector, used only for the covOU models |
gg |
a grouping vector, used only for the URWshift and covOU_vshift models |
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
).
a paleoTSfit
object with the model fitting results
For GRW, URW, Stasis, StrictStasis, ACDC and OU models, it will likely be easier to use the convenience function fitSimple
with argument method = "SSM"
.
The grouping vector, gg
, is a vector of length equal to the number of samples. It has one element for each sample and takes
integer value from 1 to the number of sample groups separated by shiftpoints. See the example below.
fitSimple
, opt.joint.GRW
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.