  We consider finite state space stationary hidden Markov models (HMMs) in the
situation where the number of hidden states is unknown. We provide a
frequentist asymptotic evaluation of Bayesian analysis methods. Our main result
gives posterior concentration rates for the marginal densities, that is for the
density of a fixed number of consecutive observations. Using conditions on the
prior, we are then able to define a consistent Bayesian estimator of the number
of hidden states. It is known that the likelihood ratio test statistic for
overfitted HMMs has a nonstandard behaviour and is unbounded. Our conditions on
the prior may be seen as a way to penalize parameters to avoid this phenomenon.
Inference of parameters is a much more difficult task than inference of
marginal densities, we still provide a precise description of the situation
when the observations are i.i.d. and we allow for $2$ possible hidden states.
