velocity: Compute distribution parameters for velocity

Description Usage Arguments Details Value See Also Examples

Description

The velocity over any time interval is a bivariate normal distribution. This function computes the parameters for this distribution. The velocity in the linear model is identical to the mean velocity, so ignore the variance in that case.

Usage

1
velocity(tr, time, time.scale = NA)

Arguments

tr

The trajectory object

time

Vector of times

time.scale

The length of the intervals over which to report the direction

Details

The velocity at a time t is defined as the net rate of displacement over the time interval [t-time.scale/2, t+time.scale/2], i.e.

v(t, Δ t) = (x(t + Δ t / 2) - x(t - Δ t / 2)) / Δ t.

Value

Returns a three dimensional array indexed by ID in the trajectory, variable name and time. The variables are named x, y and var for the x and y components of the mean and the variance respectively.

See Also

bbtraj

Examples

1
2
3
4
data("vervet_monkeys", package="moveBB")

## Compute the velocity distribution parameters over two half-hour intervals
#velocity(monkey.tr, as.POSIXct(c("2011-01-18 15:15:15", "2011-01-19 16:30:00")), 1800)

moveBB documentation built on May 2, 2019, 5:50 p.m.

Related to velocity in moveBB...