simObsData: Observation error simulation tool

View source: R/simObsData.R

simObsDataR Documentation

Observation error simulation tool

Description

Simulates observed location data subject to temporal irregularity and/or location measurement error

Usage

simObsData(data, lambda, errorEllipse, ...)

## S3 method for class 'momentuHMMData'
simObsData(data, lambda, errorEllipse, ...)

## S3 method for class 'momentuHierHMMData'
simObsData(data, lambda, errorEllipse, coordLevel, ...)

Arguments

data

A momentuHMMData or momentuHierHMMData object with necessary fields 'x' (easting/longitudinal coordinates) and 'y' (northing/latitudinal coordinates)

lambda

Observation rate for location data. If NULL, location data are kept at temporally-regular intervals. Otherwise lambda is the rate parameter of the exponential distribution for the waiting times between successive location observations, i.e., 1/lambda is the expected time between successive location observations. Only the 'step' and 'angle' data streams (or multivariate normal data streams identified by mvnCoords) are subject to temporal irregularity; any other data streams are kept at temporally-regular intervals. Ignored unless a valid distribution for the 'step' (or 'mvnCoord') data stream has been specified.

errorEllipse

List providing the bounds for the semi-major axis (M; on scale of x- and y-coordinates), semi-minor axis (m; on scale of x- and y-coordinates), and orientation (r; in degrees) of location error ellipses. If NULL, no location measurement error is simulated. If errorEllipse is specified, then each observed location is subject to bivariate normal errors as described in McClintock et al. (2015), where the components of the error ellipse for each location are randomly drawn from runif(1,min(errorEllipse$M),max(errorEllipse$M)), runif(1,min(errorEllipse$m),max(errorEllipse$m)), and runif(1,min(errorEllipse$r),max(errorEllipse$r)). If only a single value is provided for any of the error ellipse elements, then the corresponding component is fixed to this value for each location. Only the 'step' and 'angle' data streams are subject to location measurement error; any other data streams are observed without error. Ignored unless a valid distribution for the 'step' data stream is specified.

...

further arguments passed to or from other methods

coordLevel

Level of the hierarchy in which the location data are obtained

Details

Simulated location data that are temporally-irregular (i.e., lambda>0) and/or with location measurement error (i.e., errorEllipse!=NULL) are returned as a data frame suitable for analysis using crawlWrap.

Value

A dataframe of:

time

Numeric time of each observed (and missing) observation

ID

The ID(s) of the observed animal(s)

x

Either easting or longitude observed location

y

Either norting or latitude observed location

...

Data streams that are not derived from location (if applicable)

...

Covariates at temporally-regular true (mux,muy) locations (if any)

mux

Either easting or longitude true location

muy

Either norting or latitude true location

error_semimajor_axis

error ellipse semi-major axis (if applicable)

error_semiminor_axis

error ellipse semi-minor axis (if applicable)

error_ellipse_orientation

error ellipse orientation (if applicable)

ln.sd.x

log of the square root of the x-variance of bivariate normal error (if applicable; required for error ellipse models in crawlWrap)

ln.sd.y

log of the square root of the y-variance of bivariate normal error (if applicable; required for error ellipse models in crawlWrap)

error.corr

correlation term of bivariate normal error (if applicable; required for error ellipse models in crawlWrap)

References

McClintock BT, London JM, Cameron MF, Boveng PL. 2015. Modelling animal movement using the Argos satellite telemetry location error ellipse. Methods in Ecology and Evolution 6(3):266-277.

See Also

crawlWrap, prepData, simData

simHierData

Examples

# extract momentuHMMData example
data <- example$m$data
lambda <- 2 # expect 2 observations per time step
errorEllipse <- list(M=c(0,50),m=c(0,50),r=c(0,180))
obsData1 <- simObsData(data,lambda=lambda,errorEllipse=errorEllipse)

errorEllipse <- list(M=50,m=50,r=180)
obsData2 <- simObsData(data,lambda=lambda,errorEllipse=errorEllipse)


momentuHMM documentation built on Oct. 19, 2022, 1:07 a.m.