  This paper introduces the hhsmm R package, which involves functions for
initializing, fitting, and predication of hidden hybrid Markov/semi-Markov
models. These models are flexible models with both Markovian and semi-Markovian
states, which are applied to situations where the model involves absorbing or
macro-states. The left-to-right models and the models with series/parallel
networks of states are two models with Markovian and semi-Markovian states. The
hhsmm also includes Markov/semi-Markov switching regression model as well as
the auto-regressive HHSMM, the nonparametric estimation of the emission
distribution using penalized B-splines, prediction of future states and the
residual useful lifetime estimation in the predict function. The commercial
modular aero-propulsion system simulation (C-MAPSS) data-set is also included
in the package, which is used for illustration of the application of the
package features. The application of the hhsmm package to the analysis and
prediction of the Spain's energy demand is also presented.
