Learn R Programming

mkde (version 0.1)

initializeDensity: Calculate raster of density values for MKDE.

Description

Given a movement data object (list) and MKDE object (list), estimate the movement variance parameters and update them in the movement data object and then compute the density for a 2D, 2.5D, or 3D MKDE.

Usage

initializeDensity(mkde.obj, move.dat, integration.step, d.thresh=1e-25)

Arguments

mkde.obj
An MKDE object created with initialize2DMKDE or initialize3DMKDE
move.dat
A move data object created with initializeMovementData
integration.step
A time step used for numerical integration over the movement trajectory
d.thresh
The value of the kernel below which its contibrution to the overal density is considered negligible

Value

A list is returned with two elements: move.dat and mkde.obj. The first is an updated move data object and the second is an updated MKDE object.

Details

This function computes the density for a 2D, 2.5D, or 3D MKDE. If the move variance parameters have not been estimated, they will be prior to computing the density. The integration time step should be much less than the maximum time step allowed between observed animal locations. For a 2.5D MKDE, if the area has been calculated with initializeAreaRaster, then the cell probabilities are weighted by the proportion of the total surface area represented by the cell.

Examples

Run this code
library(raster)
data(condor)
condor <- condor[1:10,] # simply to make example run more quickly
mv.dat <- initializeMovementData(condor$time, condor$x, condor$y, 
z.obs=condor$z, sig2obs=25.0, sig2obs.z=81.0, t.max=65.0)

data(condordem120)
cell.sz <- mean(res(condordem120))
ext <- extent(condordem120)
nx <- ncol(condordem120)
ny <- nrow(condordem120)
mkde.obj <- initializeMKDE3D(ext@xmin, cell.sz, nx, ext@ymin, cell.sz,
ny, min(values(condordem120), na.rm=TRUE), cell.sz, 25)

# note: we use a raster coarse integration time step so the
# example runs faster
dens.res <- initializeDensity(mkde.obj, mv.dat, integration.step=10.0)
mkde.obj <- dens.res$mkde.obj
mv.dat <- dens.res$move.dat

Run the code above in your browser using DataLab