# direction: Compute the (distribution of) movement direction. In moveBB: Analysis of Trajectory Data using Linear or Brownian Motion Model

## Description

Direction (in the linear motion model) and density of the direction distribution (in the BBMM) over specific time intervals.

## Usage

 ```1 2 3``` ```direction(tr, time, time.scale = NA) ddirection(d, tr, time, time.scale = NA) pdirection(d, tr, time, time.scale = NA, lower = 0) ```

## Arguments

 `tr` The trajectory object `time` A vector of times at which to report the direction `time.scale` The length of the intervals over which to report the direction `d` The direction for which to compute the density `lower` The lower end of the interval for the CDF

## Details

The direction at a time t is defined as the direction of the net displacement over the time interval [t-time.scale/2, t+time.scale/2]. Directions are in radians from the positive x axis.

Since direction has a circular distribution, the distribution function has to be computed with respect to some base value. Using the `lower` argument, one can change this base value. Thus, when calling `ddirection(x, ..., lower=l)`, the density function will be integrated from `l` to `x`. The latter may be a vector.

## Value

`direction` returns a matrix indexed by the ID in the trajectory and time. `ddirection` returns an array indexed by ID, the requested direction and time.

## References

Buchin, K., Sijben, S., Arseneau, T. J. M., AND Willems, E. P. Detecting movement patterns using brownian bridges. In Proceedings of the 20th International Conference on Advances in Geographic Information Systems, 119–128.

## See Also

`velocity`, `bbtraj`

## Examples

 ```1 2 3 4 5 6 7 8``` ```data("vervet_monkeys", package="moveBB") ## Compute the (linear model) direction over two half-hour intervals #d <- direction(monkey.tr, as.POSIXct(c("2011-01-18 15:15:15", "2011-01-19 16:30:00")), 1800) #d ## Compute the density of four directions over the same time intervals #ddirection(d, 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.