Learn R Programming

pomp (version 0.39-3)

trajectory: Compute trajectories of the determinstic skeleton.

Description

The method trajectory computes a trajectory of the deterministic skeleton of a Markov process. 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 integrates the vectorfield to obtain a trajectory.

Usage

## S3 method for class 'pomp':
trajectory(object, params, times, t0, \dots)

Arguments

object
an object of class pomp.
params
a rank-2 array of parameters. Each column of params is a distinct parameter vector.
times, t0
times is a numeric vector specifying the times at which a trajectory is desired. t0 specifies the start time (the time at which the initial conditions hold). The default for times is times=time(object,t
...
additional arguments are passed to the ODE integrator if the skeleton is a vectorfield and ignored if it is a map. See ode for a description of the additional arguments accepted.

Value

  • Returns an array of dimensions nvar x nreps 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].

Details

This function makes repeated calls to the user-supplied skeleton of the pomp object. For specifications on supplying this, see pomp.

When the skeleton is a vectorfield, trajectory integrates it using ode.

Unresolved issue: What is the behavior if type="map" and times are non-integral?

See Also

pomp, traj.match, ode

Examples

Run this code
data(euler.sir)
x <- trajectory(euler.sir)
plot(time(euler.sir),x["I",1,],type='l',xlab='time',ylab='I')
lines(time(euler.sir),x["cases",1,],col='red')

coef(euler.sir,c("gamma")) <- log(12)
x <- trajectory(euler.sir)
plot(time(euler.sir),x["I",1,],type='l',xlab='time',ylab='I')
lines(time(euler.sir),x["cases",1,],col='red')

Run the code above in your browser using DataLab