simulate-pomp              package:pomp              R Documentation

_R_u_n_n_i_n_g _s_i_m_u_l_a_t_i_o_n_s _o_f _a _p_a_r_t_i_a_l_l_y-_o_b_s_e_r_v_e_d _M_a_r_k_o_v _p_r_o_c_e_s_s

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

     'simulate' can be used to generate simulated data sets and/or to
     simulate the state process.

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

     ## S4 method for signature 'pomp':
     simulate(object, nsim = 1, seed = NULL, params,
              states = FALSE, obs = FALSE, times = time(object,t0=TRUE),
              ...)

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

  object: An object of class 'pomp'.

    nsim: The number of simulations to perform. Note that the number of
          replicates will be 'nsim' times 'ncol(xstart)'. 

    seed: optional; the random seed to use.

  params: The parameters to use in simulating the model. If 'params' is
          not given, then the contents of the 'params' slot of 'object'
          will be used, if they exist. 

  states: Do we want the state trajectories?

     obs: Do we want data-frames of the simulated observations?

   times: The times for which observations are required. Note that the
          first element in 'times' is the start time. 

     ...: further arguments that are at present ignored.

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

     Simulation of the state process and of the measurement process are
     each accomplished by a single call to the user-supplied 'rprocess'
     and 'rmeasure' functions, respectively. This makes it possible for
     the user to write highly optimized code for these potentially
     expensive computations.

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

     If 'states=FALSE' and 'obs=FALSE' (the default), a list of 'nsim'
     'pomp' objects is returned. Each has a simulated data set,
     together with the parameters used (in slot 'params') and the state
     trajectories also (in slot 'states'). If 'times' is specified,
     then the 't0' slot of the created `pomp' objects will be filled
     with 'times[1]' and the simulated observations will be at times
     'times[-1]'.

     If 'nsim=1', then a single 'pomp' object is returned (and not a
     singleton list).

     If 'states=TRUE' and 'obs=FALSE', simulated state trajectories are
     returned as a rank-3 array with dimensions 'nvar' x
     '(ncol(params)*nsim)' x 'ntimes'. Here, 'nvar' is the number of
     state variables and 'ntimes' the length of the argument 'times'.
     The measurement process is not simulated in this case.   

     If 'states=FALSE' and 'obs=TRUE', simulated observations are
     returned as a rank-3 array with dimensions 'nobs' x
     '(ncol(params)*nsim)' x 'ntimes'. Here, 'nobs' is the number of
     observables.

     If both 'states=TRUE' and 'obs=TRUE', then a named list is
     returned. It contains the state trajectories and simulated
     observations as above.

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

     Aaron A. King kingaa at umich dot edu

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

     pomp-class

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

     data(ou2)
     x <- simulate(ou2,seed=3495485,nsim=10)
     x <- simulate(ou2,seed=3495485,nsim=10,states=TRUE,obs=TRUE)

