fitMovRes: Fit a Moving-Resting Model with Embedded Brownian Motion

Description Usage Arguments Value References Examples

View source: R/movres.R

Description

Fit a Moving-Resting Model with Embedded Brownian Motion with animal movement data at discretely observation times by maximizing a composite likelihood constructed from the marginal density of increment.

Usage

1
2
3
fitMovRes(data, start, likelihood = c("full", "composite"), logtr = FALSE,
  method = "Nelder-Mead", optim.control = list(),
  integrControl = integr.control())

Arguments

data

a data.frame whose first column is the observation time, and other columns are location coordinates.

start

starting value of the model, a vector of three components in the order of rate for moving, rate for resting, and volatility.

likelihood

a character string specifying the likelihood type to maximize in estimation. This can be "full" for full likelihood or "composite' for composite likelihood. full loglikelihood from hidden Markov model approach.

logtr

logical, if TRUE parameters are estimated on the log scale.

method

the method argument to feed optim.

optim.control

a list of control to be passed to optim.

integrControl

a list of control parameters for the integrate function: rel.tol, abs.tol, subdivision.

Value

a list of the following components:

estimate

the esimated parameter vector

loglik

maximized loglikelihood or composite loglikelihood evaluated at the estimate

convergence

convergence code from optim

likelihood

likelihood type (full or composite) from the input

References

Yan, J., Chen, Y., Lawrence-Apfel, K., Ortega, I. M., Pozdnyakoc, V., Williams, S., and Meyer, T. (2014) A moving-resting process with an embedded Brownian motion for animal movements. Population Ecology. 56(2): 401–415.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
tgrid <- seq(0, 10, length=500)
set.seed(123)
## make it irregularly spaced
tgrid <- sort(sample(tgrid, 30)) # change to 400 for a larger sample
dat <- rMovRes(tgrid, 1, 2, 25, "m")

fit.fl <- fitMovRes(dat, start=c(2, 2, 20), likelihood = "full")
fit.fl

fit.cl <- fitMovRes(dat, start=c(2, 2, 20), likelihood = "composite")
fit.cl
## Not run: 
## old, very slow, unexported R code
fit.<- smam:::fitMovRes.cl(dat, start=c(2, 2, 2))
fit.cpp

## End(Not run)

smam documentation built on May 30, 2017, 7:23 a.m.

Related to fitMovRes in smam...