osar | R Documentation |
aniMotum
ssm
fitcalculate one-step-ahead (prediction) residuals from a aniMotum
ssm
fit
osar(x, method = "fullGaussian", ...)
x |
a |
method |
method to calculate prediction residuals
(default is |
... |
other arguments to TMB::oneStepPredict |
One-step-ahead residuals are useful for assessing goodness-of-fit
in latent variable models. This is a wrapper function for TMB::oneStepPredict
(beta version). osar
tries the fullGaussian
(fastest) method first and
falls back to the oneStepGaussianOffMode
(slower) method for any failures.
Subsequent failures are dropped from the output and a warning message is given.
Note, OSA residuals can take a considerable time to calculate if there are
many individual fits and/or deployments are long. The method is automatically
parallelised across 2 x the number of individual fits, up to the number of
processor cores available.
Thygesen, U. H., C. M. Albertsen, C. W. Berg, K. Kristensen, and A. Neilsen. 2017. Validation of ecological state space models using the Laplace approximation. Environmental and Ecological Statistics 24:317–339.
# generate a ssm fit object (call is for speed only)
xs <- fit_ssm(ellie, spdf=FALSE, model = "rw", time.step=24, control = ssm_control(verbose = 0))
res <- osar(xs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.