{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,10,2]],"date-time":"2026-10-02T19:19:52Z","timestamp":1790968792189,"version":"4.1.0"},"reference-count":44,"publisher":"Wiley","issue":"7","license":[{"start":{"date-parts":[[2022,5,27]],"date-time":"2022-05-27T00:00:00Z","timestamp":1653609600000},"content-version":"vor","delay-in-days":0,"URL":"http:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":["onlinelibrary.wiley.com"],"crossmark-restriction":true},"short-container-title":["Biometrical J"],"published-print":{"date-parts":[[2022,10]]},"abstract":"<jats:title>Abstract<\/jats:title><jats:p>A very common way to estimate the parameters of a hidden Markov model (HMM) is the relatively straightforward computation of maximum likelihood (ML) estimates. For this task, most users rely on user\u2010friendly implementation of the estimation routines via an interpreted programming language such as the statistical software environment<jats:styled-content>R<\/jats:styled-content>. Such an approach can easily require time\u2010consuming computations, in particular for longer sequences of observations. In addition, selecting a suitable approach for deriving confidence intervals for the estimated parameters is not entirely obvious, and often the computationally intensive bootstrap methods have to be applied. In this tutorial, we illustrate how to speed up the computation of ML estimates significantly via the<jats:styled-content>R<\/jats:styled-content>package<jats:styled-content>TMB<\/jats:styled-content>. Moreover, this approach permits simple retrieval of standard errors at the same time. We illustrate the performance of our routines using different data sets: first, two smaller samples from a mobile application for tinnitus patients and a well\u2010known data set of fetal lamb movements with 87 and 240 data points, respectively. Second, we rely on larger data sets of simulated data of sizes 2000 and 5000 for further analysis. This tutorial is accompanied by a collection of scripts, which are all available in the Supporting Information. These scripts allow any user with moderate programming experience to benefit quickly from the computational advantages of<jats:styled-content>TMB<\/jats:styled-content>.<\/jats:p>","DOI":"10.1002\/bimj.202100256","type":"journal-article","created":{"date-parts":[[2022,5,27]],"date-time":"2022-05-27T10:48:52Z","timestamp":1653648532000},"page":"1260-1288","update-policy":"https:\/\/doi.org\/10.1002\/crossmark_policy","source":"Crossref","is-referenced-by-count":9,"title":["A gentle tutorial on accelerated parameter and confidence interval estimation for hidden Markov models using Template Model Builder"],"prefix":"10.1002","volume":"64","author":[{"given":"Timoth\u00e9e","family":"Bacri","sequence":"first","affiliation":[{"name":"Department of Mathematics University of Bergen Bergen Norway"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Geir D.","family":"Berentsen","sequence":"additional","affiliation":[{"name":"Department of Business and Management Science Norwegian School of Economics Helleveien Bergen Norway"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-3308-0652","authenticated-orcid":false,"given":"Jan","family":"Bulla","sequence":"additional","affiliation":[{"name":"Department of Mathematics University of Bergen Bergen Norway"},{"name":"Department of Psychiatry and Psychotherapy University of Regensburg Universit\u00e4tsstra\u00dfe Regensburg Germany"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Sondre","family":"H\u00f8lleland","sequence":"additional","affiliation":[{"name":"Department of Business and Management Science Norwegian School of Economics Helleveien Bergen Norway"},{"name":"Department of Pelagic Fish Institute of Marine Research Bergen Norway"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"311","published-online":{"date-parts":[[2022,5,27]]},"reference":[{"key":"e_1_2_11_2_1","first-page":"101","article-title":"Stochastic weather generators: An overview of weather type models","volume":"156","author":"Ailliot P.","year":"2015","journal-title":"Journal de la soci\u00e9t\u00e9 fran\u00e7aise de statistique"},{"key":"e_1_2_11_3_1","doi-asserted-by":"publisher","DOI":"10.1201\/b13246"},{"key":"e_1_2_11_4_1","doi-asserted-by":"publisher","DOI":"10.1214\/aoms\/1177699147"},{"key":"e_1_2_11_5_1","doi-asserted-by":"publisher","DOI":"10.1214\/aoms\/1177697196"},{"key":"e_1_2_11_6_1","doi-asserted-by":"crossref","unstructured":"Berentsen G. D. Bulla J. Maruotti A. &St\u00f8ve B.(2022).Modeling clusters of corporate defaults: Regime\u2010switching models significantly reduce the contagion source.Journal of the Royal Statistical Society: Series C.https:\/\/rss.onlinelibrary.wiley.com\/doi\/10.1111\/rssc.12551","DOI":"10.1111\/rssc.12551"},{"key":"e_1_2_11_7_1","doi-asserted-by":"publisher","DOI":"10.1007\/s00180-007-0063-y"},{"key":"e_1_2_11_8_1","volume-title":"Inference in hidden Markov models","author":"Capp\u00e9 O.","year":"2006"},{"key":"e_1_2_11_9_1","doi-asserted-by":"publisher","DOI":"10.1007\/s00180-007-0097-1"},{"key":"e_1_2_11_10_1","doi-asserted-by":"publisher","DOI":"10.1111\/j.2517-6161.1977.tb01600.x"},{"key":"e_1_2_11_11_1","doi-asserted-by":"publisher","DOI":"10.1111\/rssb.12187"},{"key":"e_1_2_11_12_1","doi-asserted-by":"publisher","DOI":"10.1017\/CBO9780511790492"},{"key":"e_1_2_11_13_1","doi-asserted-by":"publisher","DOI":"10.1093\/bioinformatics\/14.9.755"},{"key":"e_1_2_11_14_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-1-4899-4541-9"},{"key":"e_1_2_11_15_1","volume-title":"An introduction to probability theory and its applications","author":"Feller W.","year":"1968"},{"key":"e_1_2_11_16_1","doi-asserted-by":"publisher","DOI":"10.1007\/s11222-021-10012-y"},{"key":"e_1_2_11_17_1","doi-asserted-by":"publisher","DOI":"10.2307\/2532301"},{"key":"e_1_2_11_18_1","volume-title":"Finite mixture and Markov switching models","author":"Fr\u00fchwirth\u2010Schnatter S.","year":"2006"},{"key":"e_1_2_11_19_1","doi-asserted-by":"publisher","DOI":"10.1561\/2000000004"},{"key":"e_1_2_11_20_1","first-page":"1","article-title":"Usage summary for selected optimization routines","volume":"153","author":"Gay D. M.","year":"1990","journal-title":"Computing Science Technical Report"},{"key":"e_1_2_11_21_1","doi-asserted-by":"crossref","DOI":"10.1093\/oso\/9780198572237.001.0001","volume-title":"Probability and random processes","author":"Grimmett G.","year":"2001"},{"key":"e_1_2_11_22_1","doi-asserted-by":"publisher","DOI":"10.2307\/1912559"},{"key":"e_1_2_11_23_1","doi-asserted-by":"publisher","DOI":"10.1111\/j.1751-5823.2003.tb00485.x"},{"key":"e_1_2_11_24_1","doi-asserted-by":"publisher","DOI":"10.1080\/01621459.1989.10478825"},{"key":"e_1_2_11_25_1","doi-asserted-by":"publisher","DOI":"10.18637\/jss.v070.i05"},{"key":"e_1_2_11_26_1","doi-asserted-by":"publisher","DOI":"10.2307\/2532308"},{"key":"e_1_2_11_27_1","doi-asserted-by":"publisher","DOI":"10.1198\/106186002402"},{"key":"e_1_2_11_28_1","doi-asserted-by":"publisher","DOI":"10.1111\/ele.13610"},{"key":"e_1_2_11_29_1","doi-asserted-by":"publisher","DOI":"10.1002\/047172842X"},{"key":"e_1_2_11_30_1","doi-asserted-by":"publisher","DOI":"10.2307\/2684811"},{"key":"e_1_2_11_31_1","unstructured":"Mersmann O.(2021).microbenchmark: Accurate timing functions. R package version 1.4.9."},{"key":"e_1_2_11_32_1","doi-asserted-by":"publisher","DOI":"10.1007\/s11831-020-09422-4"},{"key":"e_1_2_11_33_1","unstructured":"Pohle J. Langrock R. vanBeest F. &Schmidt N. M.(2017a).Selecting the number of states in hidden Markov models\u2014Pitfalls practical challenges and pragmatic solutions.https:\/\/arxiv.org\/abs\/1701.08673"},{"key":"e_1_2_11_34_1","doi-asserted-by":"publisher","DOI":"10.1007\/s13253-017-0283-8"},{"key":"e_1_2_11_35_1","doi-asserted-by":"publisher","DOI":"10.1038\/srep31166"},{"key":"e_1_2_11_36_1","doi-asserted-by":"publisher","DOI":"10.3389\/fnagi.2017.00253"},{"key":"e_1_2_11_37_1","doi-asserted-by":"crossref","unstructured":"Pryss R. Reichert M. Herrmann J. Langguth B. &Schlee W.(2015).Mobile crowd sensing in clinical and psychological trials\u2014A case study. In2015 IEEE 28th international symposium on computer\u2010based medical systems IEEE pp.23\u201324.","DOI":"10.1109\/CBMS.2015.26"},{"key":"e_1_2_11_38_1","doi-asserted-by":"crossref","unstructured":"Pryss R. Reichert M. Langguth B. &Schlee W.(2015).Mobile crowd sensing services for tinnitus assessment therapy and research. In2015 IEEE international conference on mobile services IEEE pp.352\u2013359.","DOI":"10.1109\/MobServ.2015.55"},{"key":"e_1_2_11_39_1","unstructured":"R Core Team(2021).R: A language and environment for statistical computing.R Foundation for Statistical Computing."},{"key":"e_1_2_11_40_1","doi-asserted-by":"publisher","DOI":"10.1101\/gr.8.3.222"},{"key":"e_1_2_11_41_1","doi-asserted-by":"publisher","DOI":"10.1016\/j.csda.2008.01.029"},{"key":"e_1_2_11_42_1","doi-asserted-by":"publisher","DOI":"10.2307\/2347496"},{"key":"e_1_2_11_43_1","doi-asserted-by":"publisher","DOI":"10.1348\/000711000159240"},{"key":"e_1_2_11_44_1","doi-asserted-by":"publisher","DOI":"10.1090\/S0002-9947-1943-0012401-3"},{"key":"e_1_2_11_45_1","doi-asserted-by":"publisher","DOI":"10.1201\/b20790"}],"container-title":["Biometrical Journal"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/onlinelibrary.wiley.com\/doi\/pdf\/10.1002\/bimj.202100256","content-type":"application\/pdf","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/onlinelibrary.wiley.com\/doi\/full-xml\/10.1002\/bimj.202100256","content-type":"application\/xml","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/onlinelibrary.wiley.com\/doi\/pdf\/10.1002\/bimj.202100256","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2023,11,22]],"date-time":"2023-11-22T08:31:59Z","timestamp":1700641919000},"score":1,"resource":{"primary":{"URL":"https:\/\/onlinelibrary.wiley.com\/doi\/10.1002\/bimj.202100256"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2022,5,27]]},"references-count":44,"journal-issue":{"issue":"7","published-print":{"date-parts":[[2022,10]]}},"alternative-id":["10.1002\/bimj.202100256"],"URL":"https:\/\/doi.org\/10.1002\/bimj.202100256","archive":["Portico"],"relation":{},"ISSN":["0323-3847","1521-4036"],"issn-type":[{"value":"0323-3847","type":"print"},{"value":"1521-4036","type":"electronic"}],"subject":[],"published":{"date-parts":[[2022,5,27]]},"assertion":[{"value":"2021-08-23","order":0,"name":"received","label":"Received","group":{"name":"publication_history","label":"Publication History"}},{"value":"2022-04-01","order":1,"name":"accepted","label":"Accepted","group":{"name":"publication_history","label":"Publication History"}},{"value":"2022-05-27","order":2,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}