Learn R Programming

ctmcmove (version 1.2.1)

ctmc2glm: Convert a "ctmc" object into Poisson glm format.

Description

Transforms a "ctmc" object and covariate rasters into data suitable for analysis using Poisson GLM software (like glm in R).

Usage

ctmc2glm(ctmc, stack.static, stack.grad, crw = TRUE,
    normalize.gradients = FALSE, grad.point.decreasing = TRUE,
    include.cell.locations=TRUE)

Arguments

ctmc
A "ctmc" object (output from "path2ctmc").
stack.static
A rasterStack object, where each layer in the stack is a location-based covariate.
stack.grad
A rasterStack object, where each layer in the stack is a directional gradient-based covariate
crw
Logical. If TRUE (default), an autocovariate is created for each cell visited in the CTMC movement path. The autocovariate is a unit-length directional vector pointing from the center of the most recent grid cell to the center of the current grid
normalize.gradients
Logical. Default is FALSE. If TRUE, then all gradient covariates are normalized by dividing by the length of the gradient vector at each point.
grad.point.decreasing
Logical. If TRUE, then the gradient covariates are positive in the direction of decreasing values of the covariate. If FALSE, then the gradient covariates are positive in the direction of increasing values of the covariate (like a true gradient).
include.cell.locations
Logical. If TRUE, then the x and y locations of the centers of the (1) current and (2) neighboring raster cells will be returned for each row in the created data matrix.

Value

  • zResponse variable (either zero or 1) for analysis using GLM software.
  • XMatrix of predictor variables for analysis using GLM software. Created from the location-based and gradient-based covariates.
  • tauOffset for each row in a Poisson GLM with log link.
  • tVector of the time each raster grid cell was entered

Details

This code creates one data row for each possible transition from each grid cell visited by the CTMC path.

References

Hanks, E. M.; Hooten, M. B. & Alldredge, M. W. Continuous-time Discrete-space Models for Animal Movement The Annals of Applied Statistics, 2015, 9, 145-165

Examples

Run this code
## For example code, do
##
## > help(ctmcMove)

Run the code above in your browser using DataLab