Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

osar

calculate one-step-ahead (prediction) residuals from a foieGras fit


Description

calculate one-step-ahead (prediction) residuals from a foieGras fit

Usage

osar(x, method = "fullGaussian", ...)

Arguments

x

a compound fG tbl fit object

method

method to calculate prediction residuals (default is "oneStepGaussianOffMode"; see ?TMB::oneStepPrediction for details)

...

other arguments to TMB::oneStepPrediction

Details

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 parallelized across 2 x the number of individual fits, up to the number of processor cores available.

References

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.

Examples

## generate a fG_ssm fit object (call is for speed only)
xs <- fit_ssm(sese2, spdf=FALSE, model = "rw", time.step=72, 
control = ssm_control(se = FALSE, verbose = 0))

## just use one seal to save time
dres <- osar(xs[2,])

foieGras

Fit Continuous-Time State-Space and Latent Variable Models for Quality Control of Argos Satellite (and Other) Telemetry Data and for Estimating Movement Behaviour

v0.7-6
MIT + file LICENSE
Authors
Ian Jonsen [aut, cre, cph], Toby Patterson [aut, ctb]
Initial release
2021-04-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.