[Pomp-commits] r509 - in pkg: . inst inst/doc man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Jun 3 15:35:37 CEST 2011
Author: kingaa
Date: 2011-06-03 15:35:37 +0200 (Fri, 03 Jun 2011)
New Revision: 509
Modified:
pkg/DESCRIPTION
pkg/inst/NEWS
pkg/inst/doc/advanced_topics_in_pomp.Rnw
pkg/man/pfilter.Rd
pkg/man/plugins.Rd
pkg/man/pomp.Rd
pkg/man/simulate-pomp.Rd
Log:
- many minor improvements to the help pages
Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION 2011-06-02 15:55:14 UTC (rev 508)
+++ pkg/DESCRIPTION 2011-06-03 13:35:37 UTC (rev 509)
@@ -1,8 +1,8 @@
Package: pomp
Type: Package
Title: Statistical inference for partially observed Markov processes
-Version: 0.38-2
-Date: 2011-06-02
+Version: 0.38-3
+Date: 2011-06-03
Author: Aaron A. King, Edward L. Ionides, Carles Breto, Steve Ellner, Bruce Kendall, Helen Wearing, Matthew J. Ferrari, Michael Lavine, Daniel C. Reuman
Maintainer: Aaron A. King <kingaa at umich.edu>
URL: http://pomp.r-forge.r-project.org
Modified: pkg/inst/NEWS
===================================================================
--- pkg/inst/NEWS 2011-06-02 15:55:14 UTC (rev 508)
+++ pkg/inst/NEWS 2011-06-03 13:35:37 UTC (rev 509)
@@ -1,5 +1,8 @@
NEWS
+0.38-3
+ o Many minor clarifications in the help pages.
+
0.38-2
o A new section describing and demonstrating nonlinear forecasting has been added to the "intro to pomp" vignette.
Modified: pkg/inst/doc/advanced_topics_in_pomp.Rnw
===================================================================
--- pkg/inst/doc/advanced_topics_in_pomp.Rnw 2011-06-02 15:55:14 UTC (rev 508)
+++ pkg/inst/doc/advanced_topics_in_pomp.Rnw 2011-06-03 13:35:37 UTC (rev 509)
@@ -213,7 +213,12 @@
file.show(file=system.file("examples/ou2.c",package="pomp"))
@
The one-step simulator is in function \code{ou2\_step}.
-We can put this into the \code{pomp} object and simulate as before by doing
+Prototypes for the one-step simulator and other functions are in the \code{pomp.h} header file;
+view it by doing
+<<view-pomp.h,eval=F,results=hide>>=
+file.show(file=system.file("include/pomp.h",package="pomp"))
+@
+We can put the one-step simulator into the \code{pomp} object and simulate as before by doing
<<plugin-C-code>>=
ou2.Cplug <- pomp(
ou2.Rplug,
@@ -246,7 +251,7 @@
The function \code{ou2\_adv} is a fully vectorized version of the simulator written in C.
View this code by doing
-<<eval=F>>=
+<<eval=F,results=hide>>=
<<view-ou2-source>>
@
This function is called in the following \code{rprocess} function.
Modified: pkg/man/pfilter.Rd
===================================================================
--- pkg/man/pfilter.Rd 2011-06-02 15:55:14 UTC (rev 508)
+++ pkg/man/pfilter.Rd 2011-06-03 13:35:37 UTC (rev 509)
@@ -27,10 +27,9 @@
An object of class \code{pomp} or inheriting class \code{pomp}.
}
\item{params}{
- A \code{npars} x \code{Np} matrix containing the parameters corresponding to the initial state values in \code{xstart}.
+ A \code{npars} x \code{Np} numeric matrix containing the parameters corresponding to the initial state values in \code{xstart}.
This must have a \sQuote{rownames} attribute.
- It is permissible to supply \code{params} as a named numeric vector, i.e., without a \code{dim} attribute.
- In this case, all particles will inherit the same parameter values.
+ If it desired that all particles should share the same parameter values, one one may supply \code{params} as a named numeric vector.
}
\item{Np}{
integer; number of particles to use.
Modified: pkg/man/plugins.Rd
===================================================================
--- pkg/man/plugins.Rd 2011-06-02 15:55:14 UTC (rev 508)
+++ pkg/man/plugins.Rd 2011-06-03 13:35:37 UTC (rev 509)
@@ -22,8 +22,8 @@
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 an \R function, it should be of the form \code{step.fun(x,t,params,delta.t,...)}.
- Here, \code{x} is a named vector containing the value of the state process at time \code{t},
- \code{params} is a named vector containing parameters,
+ Here, \code{x} is a named numeric vector containing the value of the state process at time \code{t},
+ \code{params} is a named numeric vector containing parameters,
and \code{delta.t} is the length of the Euler time-step.
If \code{step.fun} is the name of 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 \pkg{pomp} package.
For details on how to write such codes, see Details.
@@ -32,8 +32,8 @@
This can be either an \R function or the name of a compiled, dynamically loaded native function that computes the transition rates.
If it is an \R function, it should be of the form \code{rate.fun(j,x,t,params,...)}.
Here, \code{j} is the number of the event,
- \code{x} is a named vector containing the value of the state process at time \code{t} and
- \code{params} is a named vector containing parameters.
+ \code{x} is a named numeric vector containing the value of the state process at time \code{t} and
+ \code{params} is a named numeric vector containing parameters.
If \code{rate.fun} is a native function, it must be of type \dQuote{pomp_ssa_rate_fn} as defined in the header \dQuote{pomp.h}, which is included with the package.
For details on how to write such codes, see Details.
}
@@ -48,8 +48,8 @@
\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.
If it is an R function, it should be of the form \code{dens.fun(x1,x2,t1,t2,params,...)}.
- Here, \code{x1} and \code{x2} are named vectors containing the values of the state process at times \code{t1} and \code{t2},
- \code{params} is a named vector containing parameters.
+ Here, \code{x1} and \code{x2} are named numeric vectors containing the values of the state process at times \code{t1} and \code{t2},
+ \code{params} is a named numeric vector containing parameters.
If \code{dens.fun} is the name of a native function, it should be of type \dQuote{pomp_onestep_pdf} as defined in the header \dQuote{pomp.h}, which is included with the \pkg{pomp} package.
This function should return the log likelihood of a transition from \code{x1} at time \code{t1} to \code{x2} at time \code{t2}, assuming that no intervening transitions have occurred.
For details on how to write such codes, see Details.
Modified: pkg/man/pomp.Rd
===================================================================
--- pkg/man/pomp.Rd 2011-06-02 15:55:14 UTC (rev 508)
+++ pkg/man/pomp.Rd 2011-06-03 13:35:37 UTC (rev 509)
@@ -128,7 +128,7 @@
An optional string giving the name of the dynamically loaded library in which any native routines are to be found.
}
\item{\dots}{
- Any additional arguments are passed as arguments to each of the functions \code{rprocess}, \code{dprocess}, \code{rmeasure}, \code{dmeasure}, and \code{initializer} whenever they are evaluated.
+ Any additional arguments given to \code{pomp} will be stored in the \code{\link[=pomp-class]{pomp}} object and passed as arguments to each of the functions \code{rprocess}, \code{dprocess}, \code{rmeasure}, \code{dmeasure}, and \code{initializer} whenever they are evaluated.
}
}
\value{
@@ -147,8 +147,9 @@
For exact simulation of certain continuous-time Markov chains, an implementation of Gillespie's algorithm is available (see \code{\link{gillespie.sim}}).
To use the plugins, consult the help documentation (\code{?\link{plugins}}) and the vignettes.
- It is anticipated that in specific cases, it may be possible to obtain increased computational efficiency by writing custom versions of \code{rprocess} and/or \code{dprocess}.
- The following describes how each of these functions should be written in this case.
+ It is anticipated that, in specific cases, it will be possible to obtain increased computational efficiency by writing custom versions of \code{rprocess} and/or \code{dprocess}.
+ See the \dQuote{Advanced Topics in pomp} vignette for a discussion of this.
+ If such custom versions are desired, the following describes how each of these functions should be written in this case.
\describe{
\item{\code{rprocess}}{
if provided, must have at least the following arguments:
@@ -202,14 +203,19 @@
\strong{At present, no methods in \pkg{pomp} make use of \code{dprocess}.}
}
+ }
+
+ The measurement-model, deterministic skeleton, and initializer components are easily specified without the use of plugins.
+ The following is a guide to writing these components.
+ \describe{
\item{\code{rmeasure}}{
if provided, must take at least the arguments \code{x}, \code{t}, \code{params}, and \code{\dots}.
It may take additional arguments, which will be filled with user-specified data as above.
- \code{x} may be assumed to be a named vector of length \code{nvars}, (which has the same meanings as above).
+ \code{x} may be assumed to be a named numeric vector of length \code{nvars}, (which has the same meanings as above).
\code{t} is a scalar quantity, the time at which the measurement is made.
- \code{params} may be assumed to be a named vector of length \code{npars}.
+ \code{params} may be assumed to be a named numeric vector of length \code{npars}.
- \code{rmeasure} must return a named vector.
+ \code{rmeasure} must return a named numeric 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}:
@@ -222,9 +228,9 @@
}
\item{\code{dmeasure}}{
if provided, must take at least the arguments \code{y}, \code{x}, \code{t}, \code{params}, \code{log}, and \code{\dots}.
- \code{y} may be assumed to be a named vector of length \code{nobs} containing (actual or simulated) values of the observed variables;
- \code{x} will be a named vector of length \code{nvar} containing state variables
- \code{params}, a named vector containing parameters;
+ \code{y} may be assumed to be a named numeric vector of length \code{nobs} containing (actual or simulated) values of the observed variables;
+ \code{x} will be a named numeric vector of length \code{nvar} containing state variables
+ \code{params}, a named numeric vector containing parameters;
and \code{t}, a scalar, the corresponding observation time.
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}.
@@ -259,19 +265,32 @@
}
\item{\code{initializer}}{
if provided, must have at least the arguments \code{params}, \code{t0}, and \code{\dots}.
- \code{params} is a named vector of parameters.
+ \code{params} is a named numeric vector of parameters.
\code{t0} will be the time at which initial conditions are desired.
- \code{initializer} must return a named vector of initial conditions.
+ \code{initializer} must return a named numeric vector of initial states.
}
}
}
\examples{
-## For examples, see the vignettes.
+## For examples, see the vignettes, the data()-loadable example \code{pomp} objects, and the provided example files.
+\dontrun{
+vignette("intro_to_pomp")
+vignette("advanced_topics_in_pomp")
+data(package="pomp")
+pomp.home <- system.file("examples",package="pomp")
+pomp.examples <- list.files(pomp.home)
+file.show(
+ file.path(pomp.home,pomp.examples),
+ header=paste("======",pomp.examples,"=======")
+ )
}
+}
\section{Warning}{
- Some error checking is done, but complete error checking is impossible.
+ Some error checking is done by \code{pomp}, but complete error checking is impossible.
If the user-specified functions do not conform to the above specifications (see Details), then the results may be invalid.
- Each algorithm that uses a \code{pomp} object uses some subset of the five basic components (\code{rprocess}, \code{dprocess}, \code{rmeasure}, \code{dmeasure}, \code{skeleton}).
+ In particular, if both \code{rmeasure} and \code{dmeasure} are specified, the user should verify that these two functions correspond to the same model and if \code{skeleton} is specified, the user is responsible for verifying that it corresponds to the true deterministic skeleton of the model.
+ Each \pkg{pomp}-package algorithm uses some subset of the five basic components (\code{rprocess}, \code{dprocess}, \code{rmeasure}, \code{dmeasure}, \code{skeleton}).
+ If an algorithm requires a component that was not given in the construction of the \code{pomp} object, an error is generated.
}
\author{Aaron A. King \email{kingaa at umich dot edu}}
\seealso{
Modified: pkg/man/simulate-pomp.Rd
===================================================================
--- pkg/man/simulate-pomp.Rd 2011-06-02 15:55:14 UTC (rev 508)
+++ pkg/man/simulate-pomp.Rd 2011-06-03 13:35:37 UTC (rev 509)
@@ -22,6 +22,7 @@
The RNG will be restored to its original state afterward.
}
\item{params}{
+ either a named numeric vector or a numeric matrix with rownames.
The parameters to use in simulating the model.
If \code{params} is not given, then the contents of the \code{params} slot of \code{object} will be used, if they exist.
}
More information about the pomp-commits
mailing list