Learn R Programming

pomp (version 1.19)

pomp methods: Functions for manipulating, displaying, and extracting information from objects of the pomp class

Description

This page documents the various methods that allow one to extract information from, display, plot, and modify pomp objects.

Usage

# S4 method for pomp
coef(object, pars, transform = FALSE, …)
# S4 method for pomp
coef(object, pars, transform = FALSE, …) <- value
# S4 method for pomp
obs(object, vars, …)
# S4 method for pomp
partrans(object, params,
      dir = c("fromEstimationScale", "toEstimationScale"), …)
# S4 method for pomp
plot(x, y, variables, panel = lines,
      nc = NULL, yax.flip = FALSE,
      mar = c(0, 5.1, 0, if (yax.flip) 5.1 else 2.1),
      oma = c(6, 0, 5, 0), axes = TRUE, …)
# S4 method for pomp
spy(object)
# S4 method for pomp
states(object, vars, …)
# S4 method for pomp
time(x, t0 = FALSE, …)
# S4 method for pomp
time(object, t0 = FALSE, …) <- value
# S4 method for pomp
timezero(object, …)
# S4 method for pomp
timezero(object, …) <- value
# S4 method for pomp
window(x, start, end, …)

Arguments

object, x

The pomp object.

pars

optional character; names of parameters to be retrieved or set.

vars

optional character; names of observed variables to be retrieved.

transform

optional logical; should the parameter transformations be applied?

value

numeric; values to be assigned.

params

a vector or matrix of parameters to be transformed.

dir

direction of the transformation. dir="toEstimationScale" applies the transformation from the model (or “natural”) scale to the “estimation” scale. dir="fromEstimationScale" applies the inverse transformation (from the estimation scale to the natural scale.

t0

logical; if TRUE on a call to time, the zero time is prepended to the time vector; if TRUE on a call to time<-, the first element in value is taken to be the initial time.

start, end

start and end times of the window.

y

ignored.

variables

optional character; names of variables to plot.

panel

a function of prototype panel(x, col, bg, pch, type, ...) which gives the action to be carried out in each panel of the display.

nc

the number of columns to use. Defaults to 1 for up to 4 series, otherwise to 2.

yax.flip

logical; if TRUE, the y-axis (ticks and numbering) should flip from side 2 (left) to 4 (right) from series to series.

mar, oma

the 'par' settings for 'mar' and 'oma' to use. Modify with care!

axes

logical; indicates if x- and y- axes should be drawn.

Further arguments (either ignored or passed to underlying functions).

Details

coef

coef(object) returns the contents of the params slot of object. coef(object,pars) returns only those parameters named in pars.

coef(object,transform=TRUE)
returns
parameter.inv.transform(coef(object)),
where parameter.inv.transform is the user parameter inverse transformation function specified when object was created. Likewise,
coef(object,pars,transform=TRUE)
returns
parameter.inv.transform(coef(object))[pars].

coef<-

Assigns values to the params slot of the pomp object. coef(object) <- value has the effect of replacing the parameters of object with value. If coef(object) exists, then coef(object,pars) <- value replaces those parameters of object named in pars with the elements of value; the names of value are ignored. If some of the names in pars do not already name parameters in coef(object), then they are concatenated. If coef(object) does not exist, then coef(object,pars) <- value assigns value to the parameters of object; in this case, the names of object will be pars and the names of value will be ignored. coef(object,transform=TRUE) <- value assigns parameter.transform(value) to the params slot of object. Here, parameter.transform is the parameter transformation function specified when object was created. coef(object,pars,transform=TRUE) <- value first, discards any names the value may have, sets names(value) <- pars, and then replaces the elements of object's params slot parameter.transform(value). In this case, if some of the names in pars do not already name parameters in coef(object,transform=TRUE), then they are concatenated.

coef(object) <- NULL erases the parameters in object.

obs

obs(object) returns the array of observations. obs(object,vars) gives just the observations of variables named in vars. vars may specify the variables by position or by name.

states

states(object) returns the array of states. states(object,vars) gives just the state variables named in vars. vars may specify the variables by position or by name.

time

time(object) returns the vector of observation times. time(object,t0=TRUE) returns the vector of observation times with the zero-time t0 prepended.

time<-

time(object) <- value replaces the observation times slot (times) of object with value. time(object,t0=TRUE) <- value has the same effect, but the first element in value is taken to be the initial time. The second and subsequent elements of value are taken to be the observation times. Those data and states (if they exist) corresponding to the new times are retained.

timezero, timezero<-

timezero(object) returns the zero-time t0. timezero(object) <- value sets the zero-time to value.

window

window(x,start=t1,end=t2 returns a new pomp object, identical to x but with only the data in the window between times t1 and t2 (inclusive). By default, start is the time of the first observation and end is the time of the last.

spy

Displays the structure of a pomp object.

plot

Plots the data and state trajectories (if the latter exist). Additional arguments are passed to the low-level plotting routine.

as

A pomp object can be coerced to a data frame via

as(object,"data.frame").
The data frame contains the times, the data, and the state trajectories, if they exist.

See Also

pomp, pomp low-level interface, simulate, pfilter, probe.