HMMSim                 package:RHmm                 R Documentation

_S_i_m_u_l_a_t_i_o_n _o_f _a_n _H_i_d_d_e_n _M_a_r_k_o_v _M_o_d_e_l

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

     Simulation of an HMM for different classes of observations
     distributions

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

     HMMSim(nSim, HMM, lastState=NULL)

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

    nSim: Number of simulations

     HMM: An HMMClass object. See *HMMSet*

lastState: Optionnal, value of the previous state of the hidden Markov
          chain

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

     a list with 

     obs: simulated observations (a vector for univariate
          distributions, a matrix for multivariate distributions)

  states: simulated hidden states

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

     'HMMSet'

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

         # simulate a 3 hidden states model with univariate normal distributions
         n_1d_3s <- distributionSet("NORMAL", mean=c(1, -2, 5), var=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))
         hmm_1d_3s <- HMMSet(initProb3, transMat3, n_1d_3s)
         simul <- HMMSim(1000, hmm_1d_3s)
         
         #Simulate 1000 more observations
         simulMore <- HMMSim(1000, hmm_1d_3s, simul$states[1000])  
         

