View source: R/forward_algorithms.R
| forward_hsmm | R Documentation |
Calculates the (approximate) log-likelihood of a sequence of observations under a homogeneous hidden semi-Markov model using a modified forward algorithm.
forward_hsmm(
dm,
omega,
allprobs,
trackID = NULL,
delta = NULL,
eps = 1e-10,
report = TRUE
)
dm |
list of length |
omega |
matrix of dimension Contains the transition probabilities given that the current state is left. Hence, the diagonal elements need to be zero and the rows need to sum to one. Can be constructed using |
allprobs |
matrix of state-dependent probabilities/ density values of dimension |
trackID |
optional vector of length If provided, the total log-likelihood will be the sum of each track's likelihood contribution.
In this case, |
delta |
optional vector of initial state probabilities of length By default, the stationary distribution is computed (which is typically recommended). |
eps |
small value to avoid numerical issues in the approximating transition matrix construction. Usually, this should not be changed. |
report |
logical, indicating whether initial distribution, approximating transition probability matrix and |
Hidden semi-Markov models (HSMMs) are a flexible extension of HMMs, where the state duration distribution is explicitly modelled by a distribution on the positive integers.
For direct numerical maximum likelhood estimation, HSMMs can be represented as HMMs on an enlarged state space (of size M) and with structured transition probabilities.
This function is designed to be used with automatic differentiation based on the R package RTMB. It will be very slow without it!
HSMM log-likelihood for given data and parameters
Langrock, R., & Zucchini, W. (2011). Hidden Markov models with arbitrary state dwell-time distributions. Computational Statistics & Data Analysis, 55(1), 715-724.
Koslik, J. O. (2025). Hidden semi-Markov models with inhomogeneous state dwell-time distributions. Computational Statistics & Data Analysis, 209, 108171.
Other forward algorithms:
forward(),
forward_g(),
forward_ihsmm(),
forward_p(),
forward_phsmm()
# currently no examples
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.