[Pomp-commits] r189 - in pkg: inst inst/doc man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Dec 30 16:45:37 CET 2009
Author: kingaa
Date: 2009-12-30 16:45:36 +0100 (Wed, 30 Dec 2009)
New Revision: 189
Modified:
pkg/inst/ChangeLog
pkg/inst/doc/advanced_topics_in_pomp.pdf
pkg/inst/doc/intro_to_pomp.Rnw
pkg/inst/doc/intro_to_pomp.pdf
pkg/man/euler.Rd
pkg/man/mif.Rd
pkg/man/pomp-package.Rd
pkg/man/pomp.Rd
Log:
- some improvements to the documentation
Modified: pkg/inst/ChangeLog
===================================================================
--- pkg/inst/ChangeLog 2009-12-28 18:10:32 UTC (rev 188)
+++ pkg/inst/ChangeLog 2009-12-30 15:45:36 UTC (rev 189)
@@ -1,5 +1,7 @@
2009-12-28 kingaa
+ * [r188] inst/ChangeLog, inst/doc/advanced_topics_in_pomp.pdf,
+ inst/doc/intro_to_pomp.pdf: - version 0.6-3
* [r187] DESCRIPTION, inst/examples/euler_sir.R: - tests/examples.R
has been improved for greater portability per suggestion of Brian
Ripley
Modified: pkg/inst/doc/advanced_topics_in_pomp.pdf
===================================================================
(Binary files differ)
Modified: pkg/inst/doc/intro_to_pomp.Rnw
===================================================================
--- pkg/inst/doc/intro_to_pomp.Rnw 2009-12-28 18:10:32 UTC (rev 188)
+++ pkg/inst/doc/intro_to_pomp.Rnw 2009-12-30 15:45:36 UTC (rev 189)
@@ -75,7 +75,7 @@
In general, it will be difficult to do some of these things.
Depending on what we wish to accomplish, however, we may not need all of these capabilities.
For example, to simulate data, all we need is \ref{it:rproc} and \ref{it:rmeas}.
-To run a particle filter (and hence to use iterated filtering, \code{mif}), one needs \ref{it:rproc} and \ref{it:rmeas}.
+To run a particle filter (and hence to use iterated filtering, \code{mif}), one needs \ref{it:rproc} and \ref{it:dmeas}.
To do MCMC, one needs \ref{it:dproc} and \ref{it:dmeas}.
Nonlinear forecasting (\code{nlf}) requires \ref{it:rproc} and \ref{it:rmeas}.
In \code{pomp}, one constructs an object of class \code{pomp} by specifying functions to do some or all of \ref{it:rproc}--\ref{it:dmeas}, along with data and other information.
@@ -158,6 +158,11 @@
Notice that \code{dprocess} returns a rank-2 array (\code{f}) with dimensions \code{ncol(params)}$times$\code{(length(times)-1)}.
Each row of \code{f} corresponds to a different parameter point; each column corresponds to a different transition.
You can think of \code{x} as an array that might have been generated by a call to the \code{rprocess} function above.
+\begin{textbf}
+[NB: At present, \code{pomp} has no methods for fitting models to data that make use of \ref{it:dproc}.
+ There is therefore at present no reason to specify \code{dprocess} in practice.
+ The example above is given purely for illustrative purposes.]
+\end{textbf}
Third, we write a measurement model simulator.
In this function, \code{x}, \code{t}, and \code{params} are states, time, and parameters, but they have a different form from those above.
Modified: pkg/inst/doc/intro_to_pomp.pdf
===================================================================
(Binary files differ)
Modified: pkg/man/euler.Rd
===================================================================
--- pkg/man/euler.Rd 2009-12-28 18:10:32 UTC (rev 188)
+++ pkg/man/euler.Rd 2009-12-30 15:45:36 UTC (rev 189)
@@ -39,13 +39,13 @@
\item{step.fun}{
This can be either an R function or the name of a compiled, dynamically loaded native function containing the model simulator.
It should be written to take a single Euler step from a single point in state space.
- If it is a native function, it must be of type \dQuote{pomp\_onestep\_sim} as defined in the header \dQuote{pomp.h}, which is included with the package.
+ If it is a native function, it must be of type \dQuote{pomp_onestep_sim} as defined in the header \dQuote{pomp.h}, which is included with the package.
For details on how to write such codes, see Details.
}
\item{dens.fun}{
This can be either an R function or a compiled, dynamically loaded native function containing the model transition log probability density function.
This function will be called to compute the log likelihood of the actual Euler steps.
- It must be of type \dQuote{pomp\_onestep\_pdf} as defined in the header \dQuote{pomp.h}, which is included with the package.
+ It must be of type \dQuote{pomp_onestep_pdf} as defined in the header \dQuote{pomp.h}, which is included with the package.
For details on how to write such codes, see Details.
}
\item{delta.t}{
@@ -71,7 +71,7 @@
}
\item{PACKAGE}{
an optional argument that specifies to which dynamically loaded library we restrict the search for the native routines.
- If this is '"base"', we search in the R executable itself.
+ If this is \dQuote{base}, we search in the R executable itself.
}
}
\details{
@@ -87,7 +87,7 @@
This is accomplished via interpolation of the covariate table.
Additional arguments may be given: these will be filled by the correspondingly-named elements in the \code{userdata} slot of the \code{pomp} object (see \code{\link{pomp}}).
- If \code{step.fun} is written in a native language, it must be a function of type "pomp\_onestep\_sim" as specified in the header "pomp.h" included with the package (see the directory "include" in the installed package directory).
+ If \code{step.fun} is written in a native language, it must be a function of type "pomp_onestep_sim" as specified in the header "pomp.h" included with the package (see the directory "include" in the installed package directory).
If \code{dens.fun} is written as an R function, it must have at least the arguments \code{x1}, \code{x2}, \code{t1}, \code{t2}, \code{params}, and \code{\dots}.
On a call to this function, \code{x1} and \code{x2} will be named vectors of state variables at times \code{t1} and \code{t2}, respectively.
@@ -96,7 +96,7 @@
This is accomplished via interpolation of the covariate table.
As above, any additional arguments will be filled by the correspondingly-named elements in the \code{userdata} slot of the \code{pomp} object (see \code{\link{pomp}}).
- If \code{dens.fun} is written in a native language, it must be a function of type "pomp\_onestep\_pdf" as defined in the header "pomp.h" included with the package (see the directory "include" in the installed package directory).
+ If \code{dens.fun} is written in a native language, it must be a function of type "pomp_onestep_pdf" as defined in the header "pomp.h" included with the package (see the directory "include" in the installed package directory).
}
\value{
\code{euler.simulate} and \code{onestep.simulate} each return a \code{nvar} x \code{nrep} x \code{ntimes} array, where \code{nvar} is the number of state variables, \code{nrep} is the number of replicate simulations (= number of columns of \code{xstart} and \code{params}), and \code{ntimes} is the length of \code{times}.
Modified: pkg/man/mif.Rd
===================================================================
--- pkg/man/mif.Rd 2009-12-28 18:10:32 UTC (rev 188)
+++ pkg/man/mif.Rd 2009-12-30 15:45:36 UTC (rev 189)
@@ -137,7 +137,7 @@
\author{Aaron A. King \email{kingaa at umich dot edu}}
\seealso{
\code{\link{mif-class}}, \code{\link{mif-methods}}, \code{\link{pomp}}, \code{\link{pomp-class}}, \code{\link{pfilter}}.
- See the \dQuote{intro\_to\_pomp} vignette for an example.
+ See the \dQuote{intro_to_pomp} vignette for an example.
}
\keyword{models}
\keyword{ts}
Modified: pkg/man/pomp-package.Rd
===================================================================
--- pkg/man/pomp-package.Rd 2009-12-28 18:10:32 UTC (rev 188)
+++ pkg/man/pomp-package.Rd 2009-12-30 15:45:36 UTC (rev 189)
@@ -20,7 +20,7 @@
The basic class, \code{\link{pomp}}, is provided to encode a partially-observed Markov process together with a uni- or multi-variate data set.
}
\section{Vignettes}{
- The vignette \sQuote{intro\_to\_pomp} illustrates the facilities of the package using familiar stochastic processes.
+ The vignette \sQuote{intro_to_pomp} illustrates the facilities of the package using familiar stochastic processes.
Run \code{vignette("intro_to_pomp")} or look at the HTML documentation to view the vignette.
}
\author{Aaron A. King \email{kingaa at umich dot edu}}
Modified: pkg/man/pomp.Rd
===================================================================
--- pkg/man/pomp.Rd 2009-12-28 18:10:32 UTC (rev 188)
+++ pkg/man/pomp.Rd 2009-12-30 15:45:36 UTC (rev 189)
@@ -27,26 +27,26 @@
This must be no later than the time of the first observation, \code{times[1]}.
}
\item{rprocess}{
- optional; a function of prototype \code{rprocess(xstart,times,params,\dots)} which simulates from the unobserved process.
+ optional; a function of prototype \code{rprocess(xstart,times,params,\dots)} that simulates from the unobserved process.
See below for details.
}
\item{dprocess}{
- optional; a function of prototype \code{dprocess(x,times,params,log,\dots)} which evaluates the likelihood of a sequence of consecutive state transitions.
+ optional; a function of prototype \code{dprocess(x,times,params,log,\dots)} that evaluates the likelihood of a sequence of consecutive state transitions.
See below for details.
}
\item{rmeasure}{
optional; the measurement model simulator.
This can be specified in one of three ways:
- (1) as a function of prototype \code{rmeasure(x,t,params,\dots)} which makes a draw from the observation process given states \code{x}, time \code{t}, and parameters \code{params}.
- (2) as the name of a native (compiled) routine with prototype \dQuote{pomp\_measure\_model\_simulator} as defined in the header file \dQuote{pomp.h}.
+ (1) as a function of prototype \code{rmeasure(x,t,params,\dots)} that makes a draw from the observation process given states \code{x}, time \code{t}, and parameters \code{params}.
+ (2) as the name of a native (compiled) routine with prototype \dQuote{pomp_measure_model_simulator} as defined in the header file \dQuote{pomp.h}.
In the above cases, if the measurement model depends on covariates, the optional argument \code{covars} will be filled with interpolated values at each call.
(3) using the formula-based \code{measurement.model} facility (see below).
}
\item{dmeasure}{
optional; the measurement model probability density function.
This can be specified in one of three ways:
- (1) as a function of prototype \code{dmeasure(y,x,t,params,log,\dots)} which computes the p.d.f. of \code{y} given \code{x}, \code{t}, and \code{params}.
- (2) as the name of a native (compiled) routine with prototype \dQuote{pomp\_measure\_model\_density} as defined in the header file \dQuote{pomp.h}.
+ (1) as a function of prototype \code{dmeasure(y,x,t,params,log,\dots)} that computes the p.d.f. of \code{y} given \code{x}, \code{t}, and \code{params}.
+ (2) as the name of a native (compiled) routine with prototype \dQuote{pomp_measure_model_density} as defined in the header file \dQuote{pomp.h}.
In the above cases, if the measurement model depends on covariates, the optional argument \code{covars} will be filled with interpolated values at each call.
(3) using the formula-based \code{measurement.model} facility (see below).
As might be expected, if \code{log=TRUE}, this function should return the log likelihood.
@@ -61,8 +61,8 @@
\item{skeleton.map}{
optional.
If we are dealing with a discrete-time Markov process, its deterministic skeleton is a map and can be specified using \code{skeleton.map} in one of two ways:
- (1) as a function of prototype \code{skeleton(x,t,params,\dots)} which evaluates the deterministic skeleton at state \code{x} and time \code{t} given the parameters \code{params}, or
- (2) as the name of a native (compiled) routine with prototype \dQuote{pomp\_vectorfield\_map} as defined in the header file \dQuote{pomp.h}.
+ (1) as a function of prototype \code{skeleton(x,t,params,\dots)} that evaluates the deterministic skeleton at state \code{x} and time \code{t} given the parameters \code{params}, or
+ (2) as the name of a native (compiled) routine with prototype \dQuote{pomp_vectorfield_map} as defined in the header file \dQuote{pomp.h}.
If the deterministic skeleton depends on covariates, the optional argument \code{covars} will be filled with interpolated values of the covariates at the time \code{t}.
}
\item{skeleton.vectorfield}{
@@ -71,7 +71,7 @@
Note that it makes no sense to specify the deterministic skeleton both as a map and as a vectorfield: an attempt to do so will generate an error.
}
\item{initializer}{
- optional; a function of prototype \code{initializer(params,t0,\dots)} which yields initial conditions for the state process when given a vector, \code{params}, of parameters.
+ optional; a function of prototype \code{initializer(params,t0,\dots)} that yields initial conditions for the state process when given a vector, \code{params}, of parameters.
By default, i.e., if it is unspecified when \code{pomp} is called, the initializer assumes any names in \code{params} that end in \dQuote{.0} correspond to initial value parameters.
These are simply copied over as initial conditions when \code{init.state} is called (see \code{\link{init.state-pomp}}).
The names of the state variables are the same as the corresponding initial value parameters, but with the \dQuote{.0} dropped.
@@ -121,12 +121,20 @@
\code{rprocess} must return a rank-3 array with rownames.
Suppose \code{x} is the array returned.
- Then \code{dim(x)=c(nvars,nreps,ntimes)}, where \code{nvars} is the number of state variables (=\code{nrow(xstart)}), \code{nreps} is the number of independent realizations simulated (=\code{ncol(xstart)}), and \code{ntimes} is the length of the vector \code{times}.
+ Then \code{dim(x)=c(nvars,nreps,ntimes)}, where \code{nvars} (=\code{nrow(xstart)}) is the number of state variables, \code{nreps} (=\code{ncol(xstart)}) is the number of independent realizations simulated, and \code{ntimes} is the length of the vector \code{times}.
\code{x[,j,k]} is the value of the state process in the \code{j}-th realization at time \code{times[k]}.
In particular, \code{x[,,1]} must be identical to \code{xstart}.
The rownames of \code{x} must correspond to those of \code{xstart}.
As mentioned above, some plug-ins are available for \code{rprocess}.
+
+ At present, the following methods make use of \code{rprocess}:
+ \itemize{
+ \item \code{\link[=simulate-pomp]{simulate}}
+ \item \code{\link{pfilter}}
+ \item \code{\link{mif}}
+ \item \code{\link{nlf}}
+ }
}
\item{\code{dprocess}}{
if provided, must have at least the following arguments:
@@ -150,6 +158,8 @@
\strong{In writing this function, you may assume that the transitions are consecutive.}
It should be quite clear that, but for this assumption, it would be quite difficult in general to write the transition probabilities.
In fact, from one perspective, the algorithms in \pkg{pomp} are designed to overcome just this difficulty.
+
+ \strong{At present, no methods in \code{pomp} make use of \code{dprocess}.}
}
\item{\code{rmeasure}}{
if provided, must take at least the arguments \code{x}, \code{t}, \code{params}, and \code{\dots}.
@@ -160,6 +170,12 @@
\code{rmeasure} must return a named vector.
If \code{y} is the returned vector, then \code{length(y)=nobs}, where \code{nobs} is the number of observable variables.
+
+ At present, the following methods make use of \code{rmeasure}:
+ \itemize{
+ \item \code{\link[=simulate-pomp]{simulate}}
+ \item \code{\link{nlf}}
+ }
}
\item{\code{dmeasure}}{
if provided, must take at least the arguments \code{y}, \code{x}, \code{times}, \code{params}, \code{log}, and \code{\dots}.
@@ -170,6 +186,12 @@
It may take additional arguments which will be filled with user-specified data as above.
\code{dmeasure} must return a single numeric value, the pdf of \code{y} given \code{x} at time \code{t}.
If \code{log=TRUE}, then the log of the pdf is returned.
+
+ At present, the following methods make use of \code{dmeasure}:
+ \itemize{
+ \item \code{\link{pfilter}}
+ \item \code{\link{mif}}
+ }
}
\item{\code{skeleton}}{
If \code{skeleton} is an R function, it must have at least the arguments \code{x}, \code{t}, \code{params}, and \code{\dots}.
@@ -184,7 +206,12 @@
\code{skeleton} must return a numeric vector of the same length as \code{x}.
The return value is interpreted as the vectorfield (if the dynamical system is continuous) or the value of the map (if the dynamical system is discrete), at the point \code{x} at time \code{t}.
- If \code{skeleton} is the name of a native routine, this routine must be of prototype \dQuote{pomp\_vectorfield\_map} as defined in the header \dQuote{pomp.h} (see the \dQuote{include} directory in the installed package directory).
+ If \code{skeleton} is the name of a native routine, this routine must be of prototype \dQuote{pomp_vectorfield_map} as defined in the header \dQuote{pomp.h} (see the \dQuote{include} directory in the installed package directory).
+
+ At present, the following methods make use of \code{skeleton}:
+ \itemize{
+ \item \code{\link{trajectory}}
+ }
}
\item{\code{initializer}}{
if provided, must have at least the arguments \code{params}, \code{t0}, and \code{\dots}.
More information about the pomp-commits
mailing list