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 (Kris- tensen 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 ex- amples, 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提供的梯度和海森矩阵时,迭代次数显著减少,表明能更高效地收敛至对数似然函数最大值。最后,我们简要指出了混合方法可能具备的优势。