Predicts the underlying state sequence for an observed sequence newdata given a hsmm model
# S3 method for hsmm
predict(object, newdata, method = "viterbi", ...)Returns a hsmm.data object, suitable for plotting.
A vector or list of observations
A vector containing the reconstructed state sequence
The lengths of each sequence
A matrix where the rows represent time steps and the columns are the probability for the respective state (only produced when method="smoothed")
An object of type hsmm
A vector or dataframe of observations
Prediction method (see details)
further arguments passed to or from other methods.
Jared O'Connell jaredoconnell@gmail.com
If method="viterbi", this technique applies the Viterbi algorithm for HSMMs, producing the most likely sequence of states given the observed data. If method="smoothed", then the individually most likely (or smoothed) state sequence is produced, along with a matrix with the respective probabilities for each state.
Guedon, Y. (2003), Estimating hidden semi-Markov chains from discrete sequences, Journal of Computational and Graphical Statistics, Volume 12, Number 3, page 604-639 - 2003
hsmmfit,predict.hsmmspec