These functions calculate the residuals of a CTMM model, which should be standardized and IID if the model correctly specified.
A correlogram method is also provided to assess remaining autocorrelation.
This function is analogous to acf
, but can handle missing data and multiple dimensions.
# S3 method for ctmm
residuals(object,data,...)# S3 method for telemetry
residuals(object,CTMM,...)
correlogram(data,dt=NULL,fast=TRUE,res=1,axes=c("x","y"))
ctmm
model object or telemetry
data object for calculating residuals.
telemetry
data object or data.frame
with time column t
and data columns axes
.
ctmm
model object.
Unused arguments.
Lag bin width. An ordered array will yield a progressive coarsening of the lags. Defaults to the median sampling interval.
Use the lag-weighted algorithm if FALSE
or the FFT algorithm if TRUE
. The slow algorithm outputs a progress bar.
Increase the discretization resolution for irregularly sampled data with res>1
. Decreases bias at the cost of smoothness.
Array of axes to calculate an average (isotropic) correlogram for.
residuals
return a residual object (class telemetry
, but flagged as residual) and correlogram
returns a correlogram object (class variogram
, but flagged as an ACF).
Given a telemetry
dataset and ctmm
model, residuals
calculates the standardized residuals of the Kalman filter, which can be tested for independence. The residuals object can then be plotted with plot
or fed into the correlogram
method to test independence. Output of the correlogram can then be plotted as well, though zoom
is much more useful.
When calculating correlograms, minimizing bias is more important than producing a overall smooth estimate. If fast=TRUE
, then res
needs to be large enough to resolve variability in the sampling interval (missing data is permitted). E.g., if the sampling interval is set to 15 minutes, but can be off by a minute or two, then res=15
is a good choice.