generate               package:depmix               R Documentation

_G_e_n_e_r_a_t_e _d_a_t_a _f_r_o_m _a _d_e_p_e_n_d_e_n_t _m_i_x_t_u_r_e _m_o_d_e_l

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

_g_e_n_e_r_a_t_e 'generate' generates a dataset according to a given 'dmm'.

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

      
             generate(ntimes,dmm,nreal=1) 

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

  ntimes: The number of repeated measurements, ie the length of the 
          time series (this may be a vector containing the lengths of
          independent  realiazations).

     dmm: Object of class 'dmm' or 'mixdmm'.

   nreal: The number of independent realizations that is to generated. 
          Each of them will have the dimension of 'ntimes'; all this
          does is replace ntimes by rep(ntimes,nreal).

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

     'generate' generates a date set of the specified dimensions 
     'ntimes' and 'nreal' using the parameter values in 'dmm',  which
     should be an object of class 'dmm' or 'mixdmm'. 'generate' does
     not handle multi group models, which can be run separately.

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

     Generate returns an object of class 'markovdata'.  The return
     object has an attribute called instates, a vector with the
     starting states of each realization.  When the model is a mixture
     the return has another attribute 'incomp' containing the
     components of each realization.

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

     Ingmar Visser i.visser@uva.nl

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

     'dmm', 'markovdata'

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

     # create a 2 state model with one continuous and one binary response
     # with start values provided in st
     st <- c(1,0.9,0.1,0.2,0.8,2,1,0.7,0.3,5,2,0.2,0.8,0.5,0.5)
     mod <- dmm(nsta=2,itemt=c(1,2), stval=st)

     # generate two series of lengths 100 and 50 respectively using above model
     gen<-generate(c(100,50),mod)

     summary(gen)
     plot(gen)

