1\name{viterbi}
2\alias{viterbi}
3\title{Viterbi algorithm}
4\description{This function calculates the optimal hidden states sequence using Viterbi's algorithm.}
5\usage{
6viterbi(HMM, obs)
7}
8\arguments{
9    \item{HMM}{a HMMClass or a HMMFitClass object.}
10    \item{obs}{The vector, matrix, data frame, list of vectors or list of matrices of observations.}
11}
12\value{a viterbiClass object which is a list with:
13\item{States}{Sequence of hidden states in 1...nStates}
14\item{logViterbiScore}{logarithm of the Viterbi's Score.}
15\item{logProbSeq}{logarithm of probability of having the sequence of states conditionally to having the observations.}
16}
17\examples{
18 data(n1d_3s)
19 ResFit <- HMMFit(obs_n1d_3s, nStates=3)
20 VitPath <- viterbi(ResFit, obs_n1d_3s)
21}
22\references{
23    Among hundreds of tutorials, you can have a look to use \cr
24    Phil Blunsom (2004) \emph{ Hidden Markov Models. }
25    \url{http://www.cs.mu.oz.au/460/2004/materials/hmm-tutorial.pdf}}
26
27\seealso{\code{\link{HMMSet}}, \code{\link{HMMFit}}}
28\keyword{hplot}
29