predict.hsmm {mhsmm}R Documentation

Prediction for hsmms

Description

Predicts the underlying state sequence for an observed sequence x given a hsmm model

Usage

## S3 method for class 'hsmm':
predict(object, x, method = "viterbi", ...)

Arguments

object An object of type hsmm
x A vector or dataframe of observations
method Prediction method (see details)
... further arguments passed to or from other methods.

Details

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 witht the respective probabilities for each state.

Value

Returns a hsmm.data object, suitable for plotting.

x A vector or data.frame of observations
s A vector containing the reconstructed state sequence
N The lengths of each sequence
p A matrix where the rows represent time steps and the columns are the probability for the respective state (only produced when method="smoothed")

Author(s)

Jared O'Connell

References

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

See Also

hsmm

Examples

##See 'hsmm' for examples

[Package mhsmm version 0.3.1 Index]