Learn R Programming

mkde (version 0.1)

mkde2Dgrid: Movement-based kernel density estimate (MKDE) in 2D using Rcpp

Description

Provides a function for 2-dimensional MKDEs.

Usage

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

Arguments

mkde.obj
A 2D or 2.5D 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 cell.

Details

This is lower-level function that call the C++ function. for estimating the movement-based density in 2D. 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(panda)
mv.dat <- initializeMovementData(panda$time, panda$x,
panda$y, t.max=185.0, sig2obs=25.0)
mv.dat <- initializeMovementData(panda$time, panda$x, panda$y, 
sig2obs=25.0, t.max=185.0)

data(pandadem)
cell.sz <- mean(res(pandadem))
ext <- extent(pandadem)
nx <- ncol(pandadem)
ny <- nrow(pandadem)
mkde.obj <- initializeMKDE2D(ext@xmin, cell.sz, nx, ext@ymin, cell.sz, ny)

res <- mkde2Dgrid(mkde.obj, mv.dat, 10.0, 1e-20)

Run the code above in your browser using DataLab