Inference in Hidden Markov Models with Explicit State Duration Distributions