Hidden Markov models (HMMs) are widely applied in studies where a discrete-valued process of interest is observed indirectly. They have for example been used to model behaviour from human and animal tracking data, disease status from medical data, and financial market volatility from stock prices. The model has two main sets of parameters: transition probabilities, which drive the latent state process, and observation parameters, which characterise the state-dependent distributions of observed variables. One particularly useful extension of HMMs is the inclusion of covariates on those parameters, to investigate the drivers of state transitions or to implement Markov-switching regression models. We present the new R package hmmTMB for HMM analyses, with flexible covariate models in both the hidden state and observation parameters. In particular, non-linear effects are implemented using penalised splines, including multiple univariate and multivariate splines, with automatic smoothness selection. The package allows for various random effect formulations (including random intercepts and slopes), to capture between-group heterogeneity. hmmTMB can be applied to multivariate observations, and it accommodates various types of response data, including continuous (bounded or not), discrete, and binary variables. Parameter constraints can be used to implement non-standard dependence structures, such as semi-Markov, higher-order Markov, and autoregressive models. Here, we summarise the relevant statistical methodology, we describe the structure of the package, and we present an example analysis of animal tracking data to showcase the workflow of the package.
翻译:隐藏的Markov 模型( HMMM) 被广泛应用到间接观测到离散的感兴趣进程的研究中。 例如,这些模型被用于模拟人类和动物跟踪数据的行为、医学数据中的疾病状况、以及股票价格中的金融市场波动。模型有两大套参数:驱动潜在状态过程的过渡概率,以及观测参数,这些参数体现了观察到的变量的根据状态分布。HMMM值的一个特别有用的延伸是,在这些参数上包括共变变量,以调查国家转型的驱动因素,或采用Markov 转换回归模型。我们用新的R包 HTMB来模拟人类和动物跟踪数据,同时在隐藏状态和观察参数中采用灵活的共变模型。特别是,使用惩罚性螺丝来实施非线效应,包括多个单数和多变数曲线,自动平稳选择。该软件包允许在这些参数上安装各种随机效果配制(包括随机抽取和斜坡度),以捕捉到不同组的变异性。 HTMB可以应用到多变式观测中,而不是在隐藏的硬体结构中进行新的变数结构,并且按我们使用的自动分析。