Learn R Programming

smam (version 0.7.2)

fitStateMRH: Estimation of states at each time point with Moving-Resting-Handling Process

Description

Estimate the state at each time point under the Moving-Resting-Handling process with Embedded Brownian Motion with animal movement data at discretely time points. See the difference between fitStateMRH and fitViterbiMRH in detail part. Using fitPartialViterbiMRH to estimate the state during a small piece of time interval.

Usage

fitStateMRH(data, theta, integrControl = integr.control())

fitViterbiMRH(data, theta, integrControl = integr.control())

fitPartialViterbiMRH( data, theta, startpoint, pathlength, integrControl = integr.control() )

Value

A data.frame contains estimated results, with elements:

  • original data be estimated.

  • conditional probability of moving, resting, handling (p.m, p.r, p.h), which is \(Pr(S(t = t_k) = s_k | X)\) for fitStateMRH; \(log-Pr(s_0, ..., s_k | X_k)\) for fitViterbiMRH, where \(X_k\) is \((X_0, ..., X_k)\); and \(log-Pr(s_k, ..., s_{k+q-1}|X)\) for fitPartialViterbiMRH.

  • estimated states with 0-moving, 1-resting, 2-handling.

Arguments

data

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

theta

the parameters for Moving-Resting-Handling model, in the order of rate of moving, rate of resting, rate of handling, volatility and switching probability.

integrControl

Integration control vector includes rel.tol, abs.tol, and subdivisions.

startpoint

Start time point of interested time interval.

pathlength

the length of interested time interval.

Author

Chaoran Hu

Details

fitStateMRH estimates the most likely state by maximizing the probability of \(Pr(S(t = t_k) = s_k | X)\), where X is the whole data and \(s_k\) is the possible sates at \(t_k\) (moving, resting or handling).

fitViterbiMRH estimates the most likely state path by maximizing \(Pr(S(t = t_0) = s_0, S(t = t_1) = s_1, ..., S(t = t_n) = s_n | X)\), where X is the whole data and \(s_0, s_1, ..., s_n\) is the possible state path.

fitPartialViterbiMRH estimates the most likely state path of a small peice of time interval, by maximizing the probability of \(Pr(S(t = t_k) = s_k, ..., S(t = t_{k+q-1}) = s_{k+q-1} | X)\), where \(k\) is the start time point and \(q\) is the length of interested time interval.

References

Pozdnyakov, V., Elbroch, L.M., Hu, C., Meyer, T., and Yan, J. (2018+) On estimation for Brownian motion governed by telegraph process with multiple off states. <arXiv:1806.00849>

See Also

rMRH for simulation. fitMRH for estimation of parameters.

Examples

Run this code
if (FALSE) {
## time consuming example
set.seed(06269)
tgrid <- seq(0, 400, by = 8)
dat <- rMRH(tgrid, 4, 0.5, 0.1, 5, 0.8, 'm')
fitStateMRH(dat, c(4, 0.5, 0.1, 5, 0.8))
fitViterbiMRH(dat, c(4, 0.5, 0.1, 5, 0.8))
fitPartialViterbiMRH(dat, c(4, 0.5, 0.1, 5, 0.8), 20, 10)
}

Run the code above in your browser using DataLab