Given a ctmm
movement model and telemetry
data, speed
simulates multiple realizations of the individual's trajectory to estimate the time-averaged speed, which is proportional to distance traveled, while speeds
estimates instantaneous speeds at a specified array of times t
. Both tortuosity (non straight-line motion between the data) and telemetry error can be accounted for. Given only a ctmm
movement model and no data, speed
calculates the average speed of the Gaussian movement process.
speed(object,...)# S3 method for ctmm
speed(object,data=NULL,level=0.95,robust=FALSE,units=TRUE,prior=TRUE,fast=TRUE,
cor.min=0.5,dt.max=NULL,error=0.01,cores=1,...)
# S3 method for telemetry
speed(object,CTMM,level=0.95,robust=FALSE,units=TRUE,prior=TRUE,fast=TRUE,cor.min=0.5,
dt.max=NULL,error=0.01,cores=1,...)
speeds(object,...)
# S3 method for ctmm
speeds(object,data=NULL,t=NULL,cycle=Inf,level=0.95,robust=FALSE,prior=FALSE,fast=TRUE,
error=0.01,cores=1,...)
# S3 method for telemetry
speeds(object,CTMM,t=NULL,cycle=Inf,level=0.95,robust=FALSE,prior=FALSE,fast=TRUE,
error=0.01,cores=1,...)
A ctmm
movement-model or telemetry
object, which requires an additional CTMM
argument.
Optional telemetry
object on which the simulations will be conditioned.
Movement model object.
Array of times to estimate instantaneous speeds at.
Average over time t
indices modulo cycle
. E.g., for t
sequenced by hours, cycle=24
gives daily the cycle of speeds. (Not yet supported.)
Confidence level to report on the estimated average speed.
Use robust statistics for the ensemble average and its confidence intervals (see Details).
Convert result to natural units.
Account for model uncertainty.
Whether or not to invoke the central-limit theorem (see emulate
) when prior=TRUE
.
Velocity correlation threshold for skipping gaps.
Absolute gap sizes to skip (in seconds), alternative to cor.min
.
Target (relative) standard error.
Number of simulations to run in parallel. cores=0
will use all cores, while cores<0
will reserve abs(cores)
.
Arguments passed to emulate
.
Returns the estimated mean speed of the sampled trajectory with CIs by default. If level=NULL
, then the ensemble of mean speeds is returned instead.
The cor.min
or dt.max
arguments are used to constrain the estimate to be derived from simulations near the data, and therefore ensure that the estimate is more reflective of the data than the model.
If data quality is poor and velocity can barely be resolved, then the sampling distribution may occassionally include impersistent motion and the ensemble mean will be infinite. In these cases robust=TRUE
can be used to report the ensemble median rather than the ensemble mean. The time average of speed
, in either case, is still the mean and the resulting quantity is still proportional to distance traveled. Furthermore, note that medians should be compared to medians and means to means, so the robust
option should be the same for all compared individuals.
# NOT RUN {
# Load package and data
library(ctmm)
data(buffalo)
Gabs <- buffalo$Gabs
GUESS <- ctmm.guess(Gabs,interactive=FALSE)
FIT <- ctmm.fit(Gabs,GUESS)
# stationary Gaussian estimate
speed(FIT)
# conditional estimate
speed(FIT,Gabs)
# }
Run the code above in your browser using DataLab