# dynBGB-methods: Calculation of the dynamic Bivariate Gausian Bridge In move: Visualizing and Analyzing Animal Track Data

## Description

This function creates a utilization distribution according to the Bivariate Gaussian Bridge model.

## Usage

 ```1 2 3 4 5 6 7 8``` ```## S4 method for signature 'dBGBvariance,RasterLayer,numeric' dynBGB(move, raster, locErr, timeStep, ...) ## S4 method for signature '.MoveTrackSingle,RasterLayer,numeric' dynBGB(move, raster, locErr, margin, windowSize, ...) ## S4 method for signature '.MoveTrackSingle,numeric,ANY' dynBGB(move, raster, locErr, ext, ...) ## S4 method for signature '.MoveTrackSingle,missing,ANY' dynBGB(move, raster, locErr, dimSize, ext, ...) ```

## Arguments

 `move` a `move` or `dBGBvariance` object. This object must be in a projection different to longitude/latitude (one suitable for euclidean geometry), use `spTransform` to transform your coordinates. `raster` a `RasterLayer` object or a numeric value. If a `RasterLayer` is provided the `dynBGB` starts to calculate the UD based on that raster. If a numeric value is provided it is interpreted as the resolution of the square raster cells (in map units); the according raster will be calculated internally. `locErr` single numeric value or vector of the length of coordinates that describes the error of the location (sender/receiver) system in map units. Or a character string with the name of the column containing the location error can be provided. `timeStep` It correspond to the size of the timer intervals taken for every integration step (in minutes). If left `NULL` 20.1 steps are taken in the shortest time interval. See 'Details'. Optional. `margin` The margin used for the behavioral change point analysis. `windowSize` The size of the moving window along the track. Larger windows provide more stable/accurate estimates of the brownian motion variance but are less well able to capture more frequent changes in behavior. `ext` Describes the amount of extension of the bounding box around the animal track. It can be numeric (same extension into all four directions), vector of two (first x, then y directional extension) or vector of four (xmin, xmax, ymin, ymax extension). Only considered in combination with a numeric raster argument or the dimSize argument. `dimSize` numeric. dimSize is only used if `raster` is not set. `dimSize` is interpreted as the number of cells along the largest dimension of the track. The according raster will be calculated internally. `...` Currently no other arguments implemented.

## Details

There are three ways to launch the `dynBGB` function:

1. Use a raster:
A RasterLayer object is set for the raster argument which is then used to calculate the UD.
(needed arguments: move, raster(=`RasterLayer`), locErr, margin, windowSize; optional arguments: timeStep)

2. Set the cell size
To set the cell size, set a numeric value for the raster argument which is used as the cell sizes of the raster.
(needed arguments: move, raster(=`numeric`), locErr, margin, windowSize, ext; optional arguments: timeStep)

3. Set the number of cells (col/row)
To set the number of cells along the largest dimension a numeric dimSize argument can be set.
(needed arguments: move, dimSize, locErr, margin, windowSize, ext; optional arguments: timeStep)

`timeStep`. The default value is the shortest time interval divided by 20.1. This means, if there is a location recorded e.g. every 40 mins, the function divides each segment into 1.99 mins chunks upon which it does the calculation. If for some reason there is one time interval of 20 secs in the track, each segment of the track will be divided into 1secs chunks, increasing the calculation time immensely. Before calculating the DBBMM, use e.g. `min(timeLag(x=`myMoveObject, `units="mins"`)) to check which is the duration of the shortest time interval of the track. If the track contains time intervals much shorter than the scheduled on the tag, set the `timeStep` e.g. to the scheduled time interval at which the tag was set, divided by 20.1.

## Value

It returns an object of the class dynBGB-class.

## Author(s)

Bart Kranstauber & Anne Scharf

## References

Kranstauber, B., Safi, K., Bartumeus, F.. (2014), Bivariate Gaussian bridges: directional factorization of diffusion in Brownian bridge models. Movement Ecology 2:5. doi:10.1186/2051-3933-2-5.

 ```1 2 3 4 5 6 7 8 9``` ```data(leroy) leroy <- leroy[230:265,] ## change projection method to aeqd and center the coordinate system to the track dataAeqd <- spTransform(leroy, CRSobj="+proj=aeqd +ellps=WGS84", center=TRUE) dBGB <- dynBGB(dataAeqd, locErr=9, raster=10, ext=0.5, windowSize=31, margin=15, timeStep=15/20.1) plot(dBGB, col=hsv(sqrt(1:700/1000))) lines(dataAeqd) ```