A popular way to estimate the parameters of a hidden Markov model (HMM) is direct numerical maximization (DNM) of the (log-)likelihood function. The advantages of employing the TMB (Kristensen et al., 2016) framework in R for this purpose were illustrated recently Bacri et al. (2022). In this paper, we present extensions of these results in two directions. First, we present a practical way to obtain uncertainty estimates in form of confidence intervals (CIs) for the so-called smoothing probabilities at moderate computational and programming effort via TMB. Our approach thus permits to avoid computer-intensive bootstrap methods. By means of several examples, we illustrate patterns present for the derived CIs. Secondly, we investigate the performance of popular optimizers available in R when estimating HMMs via DNM. Hereby, our focus lies on the potential benefits of employing TMB. Investigated criteria via a number of simulation studies are convergence speed, accuracy, and the impact of (poor) initial values. Our findings suggest that all optimizers considered benefit in terms of speed from using the gradient supplied by TMB. When supplying both gradient and Hessian from TMB, the number of iterations reduces, suggesting a more efficient convergence to the maximum of the log-likelihood. Last, we briefly point out potential advantages of a hybrid approach.
翻译:隐马尔可夫模型(HMM)参数估计的一种常用方法是直接数值最大化(DNM)其(对数)似然函数。近期Bacri等人(2022)的研究阐明了在R语言中采用TMB框架(Kristensen等人,2016)进行此项工作的优势。本文从两个方向拓展了这些成果。首先,我们提出一种实用方法,通过TMB以适中的计算和编程代价获得所谓平滑概率的不确定性估计(以置信区间形式呈现)。该方法因此避免了计算密集型自助法。通过多个示例,我们展示了所推导置信区间的特征模式。其次,我们研究了R语言中常用优化器在通过DNM估计HMM时的性能表现,重点关注采用TMB的潜在优势。通过大量模拟研究,我们考察了收敛速度、准确性以及(不良)初始值影响等指标。研究结果表明,所有优化器在使用TMB提供的梯度时均能在速度上获益。当同时使用TMB提供的梯度和海森矩阵时,迭代次数减少,表明能更高效地收敛至对数似然的最大值。最后,我们简要指出混合方法的潜在优势。