initializeDensity {mkde} | R Documentation |
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 |
move.dat |
A move data object created with |
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 |
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.
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.
Author(s)
Jeff A. Tracey, PhD
USGS Western Ecological Research Center, San Diego Field Station
jatracey@usgs.gov
James Sheppard, PhD
San Diego Zoo Institute for Conservation Research
jsheppard@sandiegozoo.org
Robert Sinkovits, PhD
San Diego Supercomputer Center
sinkovit@sdsc.edu
Glenn Lockwood, PhD
San Diego Supercomputer Center
glock@sdsc.edu
Examples
library(terra)
data(condor)
condor <- condor[1:20,] # 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)
fpath <- system.file("extdata", "condordem120.RDS", package="mkde")
condordem120 <- terra::readRDS(fpath)
cell.sz <- mean(res(condordem120))
ext <- ext(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