emHMM: EM-algorithm to fit a hidden Markov model representing the...

Description Usage Arguments Details References Examples

Description

emHMM finds the maximum likelihood estimate for the parameters of the CCRW by fitting the hidden Markov model through an Expectation Maximization (EM) algorithm.

Usage

1
2
emHMM(SL, TA, missL, SLmin, lambda, gamm, delta=c(0.5,0.5), 
kapp, notMisLoc, maxiter=10000, tol=1e-5)

Arguments

SL

numeric vector containing the step lengths

TA

numeric vector containing the turning angles

missL

integer vector containing the number of time steps between two steps. If no missing location it will be 1.

SLmin

one numeric value representing the minimum step length

lambda

numeric vector of length 2 containing the starting value for the lambdas of the two behaviors

gamm

2x2 matrix containing the starting value for the transition probability matrix

delta

numeric vector value for the probability of starting in each of the two behaviors, default value c(0.5,0.5), which means that you have an equal chance of starting in each behavior

kapp

one numeric value representing the starting value for the kappa of the von Mises distribution describing the extensive search behavior

notMisLoc

integer vector containing the index of the locations that are not missing

maxiter

one integer value representing the maximum number of iterations the EM algorithm will go through. Default = 10000.

tol

double: value that indicates the maximum allowed difference between the parameters.

Details

Will return the parameter estimates and the minimum negative log likelihood.

References

Please refer to Auger-Methe, M., A.E. Derocher, M.J. Plank, E.A. Codling, M.A. Lewis (2015-In Press) Differentiating the Levy walk from a composite correlated random walk. Methods in Ecology and Evolution. Preprint available at http://arxiv.org/abs/1406.4355

For more information on the EM-algorithm please refer to Zucchini W. and I.L. MacDonald (2009) Hidden Markov Models for Time Series: An Introduction Using R. Chapman and Hall/CRC

Examples

1
2
3
4
5
simPath <- simmCCRW(500,0.9,0.9,0.1,0.01,5,1)
formPath <- movFormat(simPath)
emHMM(formPath$SL,formPath$TA, formPath$missL, formPath$SLmin, 
      lambda=c(0.1,0.1), gamm=matrix(c(0.8,0.2,0.2,0.8),nrow=2),
      kapp=10,notMisLoc=formPath$notMisLoc)

MarieAugerMethe/CCRWvsLW documentation built on May 7, 2019, 2:50 p.m.