trajectory {pomp} | R Documentation

## Trajectory of a deterministic model

### Description

Compute trajectories of the deterministic skeleton of a Markov process.

### Usage

    ## S4 method for signature 'pomp'
    trajectory(object, params, times, t0,
      format = c("array", "data.frame"), ...,
      verbose = getOption("verbose", FALSE))

    ## S4 method for signature 'traj_match_objfun'
    trajectory(object, ...,
      verbose = getOption("verbose", FALSE))

### Arguments

`object` | an object of class ‘pomp’, or of a class that extends ‘pomp’. This will typically be the output of `pomp`, `simulate`, or one of the pomp inference algorithms.
`params` | a `npar` x `nrep` matrix of parameters. Each column is treated as an independent parameter set, in correspondence with the corresponding column of `x`.
`times` | a numeric vector (length `ntimes`) containing times at which the itineraries are desired. These must be in non-decreasing order with `times[1]>t0`.
`t0` | the time at which the initial conditions are assumed to hold.

`format`

the format in which to return the results.

`format = "array"` causes the trajectories to be returned in a rank-3 array with dimensions `nvar` x `ncol(params)` x `ntimes`. Here, `nvar` is the number of state variables and `ntimes` the length of the argument `times`.

`format = "data.frame"` causes the results to be returned as a single data frame containing the time and states. An ordered factor variable, ‘.id’, distinguishes the trajectories from one another.

`...` | Additional arguments are passed to the ODE integrator (if the skeleton is a vectorfield) and are ignored if it is a map. See `ode` for a description of the additional arguments accepted by the ODE integrator.
`verbose` | logical; if `TRUE`, diagnostic messages will be printed to the console.

### Details

In the case of a discrete-time system, the deterministic skeleton is a map and a trajectory is obtained by iterating the map. In the case of a continuous-time system, the deterministic skeleton is a vector-field; `trajectory` uses the numerical solvers in deSolve to integrate the vectorfield.

Note that the handling of `...` in `trajectory` differs from that of most other functions in pomp. In particular, it is not possible to modify the model structure in a call to `trajectory`.

### Value

`trajectory` returns an array of dimensions `nvar` x `nrep` x `ntimes`. If `x` is the returned matrix, `x[i,j,k]` is the i-th component of the state vector at time `times[k]` given parameters `params[,j]`.

### See Also

`skeleton`, `flow`

[Package pomp version 2.3 Index]