mps                package:hmm.discnp                R Documentation

_M_o_s_t _p_r_o_b_a_b_l_e _s_t_a_t_e_s.

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

     Calculates the most probable hidden state underlying each
     observation.

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

     mps(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 fitted hidden Markov model, as
          returned by 'hmm()'.  In order to make any kind of sense,
          'object' should bear some reasonable relationship to 'y'.

     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:

     For each t the maximum value of gamma_t(i), i.e. of the
     (estimated) probability that the state at time t is equal to i, is
     calculated, and the corresponding index returned.  These indices
     are interpreted as the values of the (most probable) states.  I.e.
     the states are assumed to be 1, 2, ..., K, for some K.

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

     If 'y' is a single observation sequence, then the value is a
     vector of corresponding most probable states.

     If 'y' is a matrix of replicate sequences, then the value is a
     matrix, the j-th column of which constitutes the vector of most
     probable states underlying the j-th replicate sequence.

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

     The _sequence_ of most probable states as calculated by this
     function will _not_ in general be the most probable sequence of
     states.  It may not even be a _possible_ sequence of states. This
     function looks at the state probabilities separately for each time
     t, and not at the states in their sequential context.

     To obtain the most probable sequence of states use 'viterbi()'.

_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()', 'viterbi()'

_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)
     sss.1 <- mps(y.sim,try)
     sss.2 <- mps(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-sss.1[,1] is much
     # more similar to sss.2[,1] than is sss.1[,1].
     ## End(Not run)

