crwPredict {crawl} | R Documentation |
Predict animal locations and velocities using a fitted CTCRW model and calculate measurement error fit statistics
Description
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.
Usage
crwPredict(object.crwFit, predTime = NULL, return.type = "minimal", ...)
Arguments
object.crwFit |
A model object from |
predTime |
vector of desired prediction times (numeric or POSIXct). Alternatively, a character vector specifying a time interval (see Details). |
return.type |
character. Should be one of |
... |
Additional arguments for testing new features |
Details
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 ofcrwPredict
would return both times specified viapredTime
as well as each original observed time. This is no longer the default (seereturn.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 theby
argument of theseq.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.
Value
There are three possible return types specified with return.type
:
minimal |
a data.frame with a minimal set of columns:
|
flat |
a data set is returned with the columns of the original data plus the state estimates, standard errors (se), and speed estimates |
list |
List with the following elements: |
originalData |
A data.frame with |
alpha.hat |
Predicted state |
Var.hat |
array where |
Author(s)
Devin S. Johnson
References
de Jong, P. and Penzer, J. (1998) Diagnosing shocks in time series. Journal of the American Statistical Association 93:796-806.