  We develop a recursion for hidden Markov model of any order h, which allows
us to obtain the posterior distribution of the latent state at every occasion,
given the previous h states and the observed data. With respect to the
well-known Baum-Welch recursions, the proposed recursion has the advantage of
being more direct to use and, in particular, of not requiring dummy
renormalizations to avoid numerical problems. We also show how this recursion
may be expressed in matrix notation, so as to allow for an efficient
implementation, and how it may be used to obtain the manifest distribution of
the observed data and for parameter estimation within the
Expectation-Maximization algorithm. The approach is illustrated by an
application to financial data which is focused on the study of the dynamics of
the volatility level of log-returns.
