Learn R Programming

mkde (version 0.1)

mkde3Dgrid: Movement-based kernel density estimate (MKDE) in 3D using Rcpp

Description

Provides a function for 3-dimensional MKDEs.

Usage

mkde3Dgrid(mkde.obj, move.dat, t.step, d.thresh)

Arguments

mkde.obj
A 3D MKDE object
move.dat
A move data object
t.step
An integration time step
d.thresh
A kernel density threshold

Value

An array whose elements are the estimated utilization probabilities for each voxel.

Details

This is lower-level function that call the C++ function. for estimating the movement-based density in 3D. In practice, users should call initializeDensity. The argument d.thresh is a univariate probability density beyond which the kernel contribution to the overall MKDE is assumed to be negligible. Usually this is set at a very small value and is used to prevent calculations from being performed in cells to which the kernel makes a negligible contribution.

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)
nz <- ceiling(3000.0/cell.sz)
mkde.obj <- initializeMKDE3D(ext@xmin, cell.sz, nx, ext@ymin, cell.sz,
ny, 0.0, cell.sz, nz)

res <- mkde3Dgrid(mkde.obj, mv.dat, 5.0, 1e-20)

Run the code above in your browser using DataLab