HMMSet                 package:RHmm                 R Documentation

_S_e_t _t_h_e _p_a_r_a_m_e_t_e_r_s _f_o_r _t_h_e _h_i_d_d_e_n _M_a_r_k_o_v _m_o_d_e_l_s

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

     This function is used to create a HMMClass object which contains
     the parameters of the HMM. An HMM is described by an initial state
     probability vector, a transition matrix and a distributionClass
     object.

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

     HMMSet(initProb, transMat, distribution)
     HMMSet(initProb, transMat, dis="NORMAL", mean, var)
     HMMSet(initProb, transMat, dis="NORMAL", mean, cov)
     HMMSet(initProb, transMat, dis="MIXTURE", mean, var, proportion)
     HMMSet(initProb, transMat, dis="DISCRETE", proba, labels=NULL)

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

initProb: the vector of probabilities of the initial state

transMat: the transition matrix of the hidden Markov chain

distribution: the distributionClass object of the observations

     dis: dis parameter. See *distributionSet*

    mean: mean parameter. See *distributionSet*

     var: var parameter. See *distributionSet*

     cov: cov parameter. See *distributionSet*

proportion: proportion parameter. See *distributionSet*

   proba: proba parameter. See *distributionSet*

  labels: labels parameter. See *distributionSet*

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

     an object of class HMMClass 

initProb: initial state probabilities vector

transMat: transition matrix

distribution: distributionClass object

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

     'distributionSet'

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

         # 3 hidden states Markov Model with univariate normal distributions
         # for the observations
         #   obs | hidden state = 1 are N(1, 1)
         #   obs | hidden state = 2 are N(-2, 2)
         #   obs | hidden state = 3 are N(5, 4)

             n_1d_3s <- distributionSet("NORMAL", c(1, -2, 5), c(1, 2, 4))
             initProb3 <- rep(1,3)/3
             transMat3 <- rbind(c(0.5, 0.4, 0.1), c(0.3, 0.4, 0.3),
                 c(0.2, 0.1, 0.7))
             hmm1 <- HMMSet(initProb3, transMat3, n_1d_3s)
             # or directly
             hmm2 <- HMMSet(initProb3, transMat3, "NORMAL", mean=c(1, -2, 5),
                 var=c(1, 2, 4))
      

