viterbi              package:hmm.discnp              R Documentation

_M_o_s_t _p_r_o_b_a_b_l_e _s_t_a_t_e _s_e_q_u_e_n_c_e.

_D_e_s_c_r_i_p_t_i_o_n:

     Calculates ``the'' most probable state sequence underlying each of
     one or more replicate observation sequences.

_U_s_a_g_e:

     viterbi(y, object = NULL, tpm, Rho, ispd, yval = NULL)

_A_r_g_u_m_e_n_t_s:

       y: The observations for which the underlying most probable
          hidden states are required.  May be a sequence of
          observations, or a matrix each column of which constitutes a
          (replicate) sequence of observations.

  object: An object describing a hidden Markov model, as fitted to the
          data set 'y' by 'hmm()'.

     tpm: The transition probability matrix for a hidden Markov model;
          ignored if 'object' is non-null. Should bear some reasonable
          relationship to 'y'.

     Rho: A matrix specifying the probability distributions of the
          observations for a hidden Markov model; ignored if 'object'
          is non-null. Should bear some reasonable relationship to 'y'.

    ispd: The initial state probability distribution for a hidden
          Markov model; ignored if 'object' is non-null. Should bear
          some reasonable relationship to 'y'.

    yval: The set of unique values of the observations; calculated from
          the observations 'y' if left 'NULL'.

_D_e_t_a_i_l_s:

     Applies the Viterbi algorithm to calculate ``the'' most probable
     robable state sequence underlying each observation sequences.

_V_a_l_u_e:

     If 'y' consists of a single observation sequence, the value is the
     underlying most probable observation sequence, or a matrix whose
     columns consist of such sequences if there is more than one
     (equally) most probable sequence.

     If 'y' consists of a matrix of observation sequences, the value is
     a list each entry of which is of the form described above.

_W_a_r_n_i_n_g:

     There _may_ be more than one equally most probable state sequence
     underlying a given observation sequence.  This phenomenon appears
     to be unlikely to occur in practice.

_A_u_t_h_o_r(_s):

     Rolf Turner rolf@math.unb.ca <URL: http://www.math.unb.ca/~rolf>

_R_e_f_e_r_e_n_c_e_s:

     Rabiner, L. R., "A tutorial on hidden Markov models and selected
     applications in speech recognition," Proc. IEEE vol. 77, pp. 257 -
     286, 1989.

_S_e_e _A_l_s_o:

     'hmm()', 'sim.hmm()', 'mps()'

_E_x_a_m_p_l_e_s:

     # See the help for sim.hmm() for how to generate y.sim.
     ## Not run: 
     try <- hmm(y.sim,K=2,verb=TRUE)
     vvv.1 <- viterbi(y.sim,try)
     vvv.2 <- viterbi(y.sim,tpm=P,ispd=c(0.25,0.75),Rho=R) # P and R as in the
                                                           # help for sim.hmm().
     # The order of the states has gotten swapped; 3-vvv.1[[1]] is much
     # more similar to vvv.2[[1]] than is vvv.1[[1]].

     ## End(Not run)

