The crwMEfilter
function uses a fitted model object from
crwMLE
to predict animal locations (with estimated uncertainty) at
times in the original data set and supplemented by times in predTime
.
If speedEst
is set to TRUE
, then animal log-speed is also
estimated. In addition, the measurement error shock detection filter of de
Jong and Penzer (1998) is also calculated to provide a measure for outlier
detection.
crwPredict(object.crwFit, predTime = NULL, return.type = "minimal", ...)
There are three possible return types specified with return.type
:
a data.frame with a minimal set of columns:
date_time,mu.x,mu.y,se.mu.x,se.mu.y
a data set is returned with the columns of the original data plus the state estimates, standard errors (se), and speed estimates
List with the following elements:
A data.frame with data
merged with
predTime
.
Predicted state
array where Var.hat[,,i]
is the prediction
covariance matrix for alpha.hat[,i]
.
A model object from crwMLE
.
vector of desired prediction times (numeric or POSIXct). Alternatively, a character vector specifying a time interval (see Details).
character. Should be one of "minimal","flat","list"
(see Details).
Additional arguments for testing new features
Devin S. Johnson
The requirements for data
are the same as those for fitting the model
in crwMLE
.
("predTime")
predTime
can be either passed as a separate vector of POSIXct or
numeric values for all prediction times expected in the returned object.
Note, previous versions of crwPredict
would return both times
specified via predTime
as well as each original observed time. This is
no longer the default (see return.type). If the original data were
provided as a POSIXct type, then crwPredict
can derive a sequence of
regularly spaced prediction times from the original data. This is specified
by providing a character string that corresponds to the by
argument
of the seq.POSIXt
function (e.g. '1 hour', '30 mins').
crwPredict
will round the first observed time up to the nearest unit
(e.g. '1 hour' will round up to the nearest hour, '30 mins' will round up to
the nearest minute) and start the sequence from there. The last observation
time is truncated down to the nearest unit to specify the end time.
de Jong, P. and Penzer, J. (1998) Diagnosing shocks in time series. Journal of the American Statistical Association 93:796-806.