fitStateMR {smam} | R Documentation |
Estimation of states at each time point with Moving-Resting Process
Description
Estimate the state at each time point under the Moving-Resting
process with Embedded Brownian Motion with animal movement data at
discretely time points. See the difference between fitStateMR
and fitViterbiMR
in detail part. Using fitPartialViterbiMR
to estimate the state within a small piece of time interval.
Usage
fitStateMR(data, theta, cutoff = 0.5, integrControl = integr.control())
fitViterbiMR(data, theta, cutoff = 0.5, integrControl = integr.control())
fitPartialViterbiMR(
data,
theta,
cutoff = 0.5,
startpoint,
pathlength,
integrControl = integr.control()
)
Arguments
data |
a |
theta |
the parameters for Moving-Resting model, in the order of rate of moving, rate of resting, volatility. |
cutoff |
the cut-off point for prediction. |
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. |
Details
fitStateMR
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).
fitViterbiMR
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.
fitPartialViterbiMR
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.
Value
A data.frame
contains estimated results, with elements:
original data be estimated.
conditional probability of moving, resting (
p.m
,p.r
), which isPr(S(t = t_k) = s_k | X)
forfitStateMR
;log-Pr(s_0, ..., s_k | X_k)
forfitViterbiMR
, whereX_k
is(X_0, ..., X_k)
; andlog-Pr(s_k, ..., s_{k+q-1}|X)
forfitPartialViterbiMR
.estimated states with 1-moving, 0-resting.
Author(s)
Chaoran Hu
See Also
rMR
for simulation.
fitMR
for estimation of parameters.
Examples
set.seed(06269)
tgrid <- seq(0, 400, by = 8)
dat <- rMR(tgrid, 4, 3.8, 5, 'm')
fitStateMR(dat, c(4, 3.8, 5), cutoff = 0.5)
fitViterbiMR(dat, c(4, 3.8, 5), cutoff = 0.5)
fitPartialViterbiMR(dat, c(4, 3.8, 5), cutoff = 0.5, 20, 10)