Learn R Programming

pomp (version 0.39-3)

traj.match: Trajectory matching

Description

Match trajectories to data.

Usage

## S3 method for class 'pomp':
traj.match(object, start, est,
           method = c("Nelder-Mead", "sannbox", "subplex"),
           gr = NULL, eval.only = FALSE, ...)
  ## S3 method for class 'traj.matched.pomp':
traj.match(object, start, est,
           method = c("Nelder-Mead", "sannbox", "subplex"),
           gr = NULL, eval.only = FALSE, ...)

Arguments

object
A pomp object.
start
initial guess for parameters.
est
character vector containing the names of parameters to be estimated.
method
Optimization method. Choices are subplex, sannbox, and any of the methods used by optim.
gr
Passed to optim.
eval.only
logical; if TRUE, no optimization is attempted and the log likelihood value is evaluated at the start parameters.
...
Arguments that will be passed to optim in its control list.

Value

  • An object of class traj.matched.pomp. This class inherits from class pomp and contains the following additional slots: [object Object],[object Object],[object Object]

    Available methods for objects of this type include summary and logLik. The other slots of this object can be accessed via the $ operator.

Details

Trajectory matching is accomplished using optim. The trajectory method is used for this, which in turn uses the skeleton slot of the pomp object. The quantity maximized is the likelihood of the data given the trajectory, as returned by dmeasure.

See Also

trajectory, pomp, optim, subplex

Examples

Run this code
data(ou2)
  true.p <- c(
	      alpha.1=0.9,alpha.2=0,alpha.3=-0.4,alpha.4=0.99,
	      sigma.1=2,sigma.2=0.1,sigma.3=2,
	      tau=1,
              x1.0=50,x2.0=-50
	      )
  simdata <- simulate(ou2,nsim=1,params=true.p,seed=43553)
  guess.p <- true.p
  res <- traj.match(
		    simdata,
		    start=guess.p,
		    est=c('alpha.1','alpha.3','alpha.4','x1.0','x2.0','tau'),
		    maxit=2000,
		    method="Nelder-Mead",
		    reltol=1e-8
		    )

  summary(res)

  plot(range(time(res)),range(c(obs(res),states(res))),type='n',xlab="time",ylab="x,y")
  points(y1~time,data=as(res,"data.frame"),col='blue')
  points(y2~time,data=as(res,"data.frame"),col='red')
  lines(x1~time,data=as(res,"data.frame"),col='blue')
  lines(x2~time,data=as(res,"data.frame"),col='red')

Run the code above in your browser using DataLab