Finds through dynamic programming the most likely sequence of states
Details
Does Global decoding through dynamic programming. It is not feasible to maximize over all possible states because this would run in O(m^t). Thus Viterbi is used as an alternative to this approach.
Examples
X = earthquakes$n
delta = c(0.5,0.5)
trans=matrix(c(0.9,0.1,0.1,0.9),2,2)
hm = HMM(initial_dist = delta,transmission = trans,emis_names = "dpois",parameterlist = list(list(lambda =10),list(lambda =30)))
viterbi(hm,X)
#> $path
#> [1] 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 2 2 2 2 2 2 1 1 2 1 1 2 2 2
#> [38] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 1 1 2 1 1 1 1 2 1 1 2 2 2 2 1 1
#> [75] 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
#>
#> $path_prob
#> [1] 0.1137364
#>