"One point of departure between my and QP’s post relates to the library/package used to estimate the hidden markov model. While QP used the RHmm package, I can only use the depmixS4 package (RHmm seems to be incompatible with newer versions of R…at least for me). As far as I can tell,the depmixS4 package does not support forecasting which means that I will probably not be able to take a gander at the out-of-sample issues alluded to above"
The starting point for this is the discussion on stack exchange.