Multi-scale Modeling of Animal Movement and General Behavior Data Using Hidden Markov Models with Hierarchical Structures

  • Vianey Leos-Barajas
  • Eric J. Gangloff
  • Timo Adam
  • Roland Langrock
  • Floris M. van Beest
  • Jacob Nabe-Nielsen
  • Juan M. Morales


Hidden Markov models (HMMs) are commonly used to model animal movement data and infer aspects of animal behavior. An HMM assumes that each data point from a time series of observations stems from one of N possible states. The states are loosely connected to behavioral modes that manifest themselves at the temporal resolution at which observations are made. Due to advances in tag technology and tracking with digital video recordings, data can be collected at increasingly fine temporal resolutions. Yet, inferences at time scales cruder than those at which data are collected and, which correspond to larger-scale behavioral processes, are not yet answered via HMMs. We include additional hierarchical structures to the basic HMM framework, incorporating multiple Markov chains at various time scales. The hierarchically structured HMMs allow for behavioral inferences at multiple time scales and can also serve as a means to avoid coarsening data. Our proposed framework is one of the first that models animal behavior simultaneously at multiple time scales, opening new possibilities in the area of animal movement and behavior modeling. We illustrate the application of hierarchically structured HMMs in two real-data examples: (i) vertical movements of harbor porpoises observed in the field, and (ii) garter snake movement data collected as part of an experimental design. Supplementary materials accompanying this paper appear online.


Animal behavior Bio-logging Experimental design Latent process State-switching model Temporal resolution 



The harbor porpoise movement data were collected as part of the DEPONS project ( funded by the offshore wind developers Vattenfall, Forewind, SMart Wind, ENECO Luchterduinen, East Anglia Offshore Wind and DONG Energy. Funding for snake project provided by Iowa Science Foundation (15-11), the Gaige Award of the American Society of Ichthyologists and Herpetologists, and the National Science Foundation (IOS 0922528 to A.M. Bronikowski). EJG was partially supported by a fellowship from the ISU Office of Biotechnology. JMM received support from grant PICT 2015-0815. VLB thanks Mark S. Kaiser for his support and comments that improved earlier versions of this manuscript.

Supplementary material

13253_2017_282_MOESM1_ESM.rdata (144 kb)
Supplementary material 1 (RData 144 KB)
13253_2017_282_MOESM2_ESM.rdata (8.1 mb)
Supplementary material 2 (RData 8308 KB)
13253_2017_282_MOESM3_ESM.csv (254 kb)
Supplementary material 3 (csv 253 KB)
13253_2017_282_MOESM4_ESM.cpp (1 kb)
Supplementary material 4 (cpp 0 KB)
13253_2017_282_MOESM5_ESM.r (16 kb)
Supplementary material 5 (R 16 KB)
13253_2017_282_MOESM6_ESM.csv (306 kb)
Supplementary material 6 (csv 305 KB)


  1. Biuw, M., Boehme, L., Guinet, C., Hindell, M., Costa, D., Charrassin, J.-B., Roquet, F., Bailleul, F., Meredith, M., Thorpe, S., Tremblay, Y., McDonald, B., Park, Y.-H., Rintoul, S.R., Bindoff, N., Goebel, M., Crocker, D., Lovell, P., Nicholson, J., Monks, F. & Fedak, M.A. (2007) Variations in behavior and condition of a Southern Ocean top predator in relation to in situ oceanographic conditions. Proceedings of the National Academy of Sciences, 104, 13705–13710.ADSCrossRefGoogle Scholar
  2. David, M., Dall, S.R.X. & Bshary, R (2016) Unravelling the philosophies underlying ‘animal personality’ studies: A brief re-appraisal of the field. Ethology, 122, 1–9.CrossRefGoogle Scholar
  3. DeRuiter, S.L., Langrock, R., Skirbutas, T., Goldbogen, J.A., Calambokidis, J., Friedlaender, A.S. & Southall, B.L. (2017) A multivariate mixed hidden Markov model for blue whale behaviour and responses to sound exposure. Annals of Applied Statistics, 11, 362–392.Google Scholar
  4. Dingemanse, N.J. & Dochtermann, N.A. (2013) Quantifying individual variation in behaviour: mixed-effect modelling approaches. Journal of Animal Ecology, 82, 39–54.CrossRefPubMedGoogle Scholar
  5. Fine, S., Singer, Y. & Tishby N. (1998) The hierarchical hidden Markov model: Analysis and applications. Machine Learning, 32, 41–62.CrossRefzbMATHGoogle Scholar
  6. Hart, T., Mann, R., Coulson, T., Pettorelli, N. & Trathan, P.N. (2010) Behavioural switching in a central place forager: patterns of diving behaviour in the macaroni penguin (Eudyptes chrysolophus). Marine Biology, 157, 1543–1553.CrossRefGoogle Scholar
  7. Hindell, M., McMahon, C.R., Bester, M.N., Boehme, L., Costa, D., Fedak, M.A., Guinet, C., Herraiz-Borreguero, L., Harcourt, R.G., Huckstadt, L., Kovacs, K.M., Lydersen, C., McIntyre, T., Muelbert, M., Patterson, T.A., Roquet, F., Williams, G. & Charrasin, J.-B. (2016) Circumpolar habitat use in the southern elephant seal: implications for foraging success and population trajectories. Ecosphere, 7, e01213.CrossRefGoogle Scholar
  8. Japyassú, H.F. & Malange, J. (2014) Plasticity, stereotypy, intra-individual variability and personality: handle with care. Behavioural Processes, 109, 40–47.CrossRefPubMedGoogle Scholar
  9. Kleun, E. & Brommer, J.E. (2013) Context-specific repeatability of personality traits in a wild bird: A reaction-norm perspective. Behavioral Ecology, 24, 650–658.CrossRefGoogle Scholar
  10. Langrock, R., King, R., Matthiopoulos, J., Thomas, L., Fortin, D. & Morales, J.M. (2012) Flexible and practical modeling of animal telemetry data: hidden Markov models and extensions. Ecology, 93, 2336–2342.CrossRefPubMedGoogle Scholar
  11. Langrock, R. & Zucchini, W. (2012) Hidden Markov models with arbitrary state dwell-time distributions. Computational Statistics and Data Analysis, 55, 715–724.MathSciNetCrossRefzbMATHGoogle Scholar
  12. Langrock, R., Marques, T.A., Baird, R.W. & Thomas, L. (2014) Modeling the diving behavior of whales: a latent-variable approach with feedback and semi-Markovian components. Journal of Agricultural, Biological and Environmental Statistics, 19, 82–100.MathSciNetCrossRefzbMATHGoogle Scholar
  13. Langrock, R., Kneib, T., Sohn, A. & DeRuiter, S.L. (2015) Nonparametric inference in hidden Markov models using P-splines. Biometrics, 71, 520–528.MathSciNetCrossRefPubMedzbMATHGoogle Scholar
  14. Leos-Barajas, V., Photopoulou, T., Langrock, R., Patterson, T.A., Murgatroyd, M., Watanabe, Y.Y. & Papastamatiou, Y.P. (2017) Analysis of accelerometer data using hidden Markov models. Methods in Ecology and Evolution, 8(2), 161–173.Google Scholar
  15. Li, M. & Bolker, B.M. (2017) Incorporating periodic variability in hidden Markov models for animal movement Movement Ecology, doi: 10.1186/s40462-016-0093-6.Google Scholar
  16. Luque, S.P. (2007) Diving Behaviour Analysis in R. An Introduction to the diveMove Package. R News, 7, 8–14.Google Scholar
  17. Maruotti, A. & Ryden, T. (2009) A semiparametric approach to hidden Markov models under longitudinal observations. Statistics and Computing, 19, 381–393.MathSciNetCrossRefGoogle Scholar
  18. Mathot, K.J. & Dingemanse, N.J. (2015) Plasticity and Personality. In Integrative Organismal Biology, pp. 55-69, John Wiley & Sons, NJ, Hoboken.Google Scholar
  19. McKellar, A.E., Langrock, R., Walters, J.R. & Kesler, D.C. (2015) Using mixed hidden Markov models to examine behavioural states in a cooperatively breeding bird. Behavioral Ecology, 26, 148–157.CrossRefGoogle Scholar
  20. Michelot, T., Langrock, R., Bestley, S., Jonsen, I.D., Photopoulou, T. & Patterson, T.A. (2016) Estimation and simulation of foraging trips in land-based marine predators. arXiv:1610.06953.
  21. Morales, J.M., Haydon, D.T., Frair, J., Holsinger, K.E. & Fryxell, J.M. (2004) Extracting more out of relocation data: building movement models as mixtures of random walks. Ecology, 85, 2436–2445.CrossRefGoogle Scholar
  22. Patterson, T.A., Basson, M., Bravington, M.V. & Gunn, J.S. (2009) Classifying movement behaviour in relation to environmental conditions using hidden Markov models. Journal of Animal Ecology, 78, 1113–1123.CrossRefPubMedGoogle Scholar
  23. Patterson, T.A., Parton, A., Langrock, R., Blackwell, P.G., Thomas, L. & King, R. (2016), Statistical modelling of animal movement: a myopic review and a discussion of good practice. arXiv:1603.07511.
  24. Pohle, J., Langrock, R., van Beest, F.M. & Schmidt, N.M. (2017) Selecting the number of states in hidden Markov models —– pitfalls, practical challenges and pragmatic solutions. arXiv:1701.08673.
  25. R Core Team (2016) R: A language and environment for statistical computing, R Foundation for Statistical Computing, Vienna, Austria.
  26. Réale, D., Reader, S.M., Sol, D., McDougall, P.T. & Dingemanse, N.J. (2007) Integrating animal temperament within ecology and evolution. Biological Reviews, 82(2), 291–318.CrossRefPubMedGoogle Scholar
  27. Roche, D.G., Careau, V. & Binning, S.A. (2016) Demystifying animal ’personality’ (or not): why individual variation matters to experimental biologists. Journal of Experimental Biology, 219, 3832–3843.CrossRefPubMedGoogle Scholar
  28. Schliehe-Dieks, S., Kappeler, P.M. & Langrock, R. (2012) On the application of mixed hidden Markov models to multiple behavioural time series. Interface Focus, 2, 180–189.CrossRefGoogle Scholar
  29. Sih, A., Bell, A. & Johnson, J.C. (2004) Behavioral syndromes: an ecological and evolutionary overview. Trends in Ecology and Evolution, 19(7), 372–378.CrossRefPubMedGoogle Scholar
  30. Sih, A., Mathot, K.J., Moirón, M., Montiglio, P.O., Wolf, M. & Dingemanse, N.J. (2015) Animal personality and state-behaviour feedbacks: a review and guide for empiricists. Trends in Ecology and Evolution, 30, 50–60.CrossRefPubMedGoogle Scholar
  31. Spiegel, O., Leu, S.T., Bull, C.M. & Sih, A. (2017) What’s your move? Movement as a link between personality and spatial dynamics in animal populations. Ecology Letters, 20, 3–18. doi: 10.1111/ele.12708.
  32. Stamps, J.A. (2016) Individual differences in behavioural plasticities. Biological Reviews, 91, 534–567.CrossRefPubMedGoogle Scholar
  33. Towner, A., Leos-Barajas, V., Langrock, R., Schick, R., Smale, M., Taschke, T., Jewell, O. & Papastamatiou, Y.P. (2016) Sex-specific and individual specialization for hunting strategies in white sharks. Functional Ecology, In press, doi: 10.1111/1365-2435.12613.
  34. Wisniewska, D. M., M. Johnson, J. Teilmann, L. Rojano-Doñate, J. Shearer, S. Sveegaard, L. A. Miller, U. Siebert & P. T. Madsen (2016) Ultra-high foraging rates of harbor porpoises make them vulnerable to anthropogenic disturbance. Current Biology, 26, 1441–1446.CrossRefPubMedGoogle Scholar
  35. Zucchini, W., MacDonald, I.L. & Langrock, R. (2016) Hidden Markov Models for Time Series: An Introduction using R, 2nd Edition, Chapman & Hall/CRC, FL, Boca Raton.zbMATHGoogle Scholar

Copyright information

© International Biometric Society 2017

Authors and Affiliations

  1. 1.Iowa State UniversityAmesUSA
  2. 2.Bielefeld UniversityBielefeldGermany
  3. 3.Aarhus UniversityRoskildeDenmark
  4. 4.INIBIOMA-CONICETBarilocheArgentina

Personalised recommendations