[Pomp-commits] r809 - www/vignettes
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Jan 10 01:23:22 CET 2013
Author: kingaa
Date: 2013-01-10 01:23:21 +0100 (Thu, 10 Jan 2013)
New Revision: 809
Modified:
www/vignettes/advanced_topics_in_pomp.R
www/vignettes/advanced_topics_in_pomp.Rnw
www/vignettes/advanced_topics_in_pomp.pdf
www/vignettes/intro_to_pomp.R
www/vignettes/intro_to_pomp.Rnw
www/vignettes/intro_to_pomp.pdf
Log:
- update the vignettes for version 0.44-1 of pomp
Modified: www/vignettes/advanced_topics_in_pomp.R
===================================================================
--- www/vignettes/advanced_topics_in_pomp.R 2013-01-09 23:07:58 UTC (rev 808)
+++ www/vignettes/advanced_topics_in_pomp.R 2013-01-10 00:23:21 UTC (rev 809)
@@ -13,7 +13,7 @@
###################################################
### code chunk number 2: plugin-R-code
###################################################
-data(ou2)
+pompExample(ou2)
ou2.dat <- as.data.frame(ou2)
pomp(
@@ -411,7 +411,7 @@
###################################################
### code chunk number 24: advanced_topics_in_pomp.Rnw:490-497
###################################################
-data(ou2)
+pompExample(ou2)
true.p <- coef(ou2)
x0 <- init.state(ou2)
x0
@@ -454,9 +454,9 @@
###################################################
-### code chunk number 29: all-data-loadable (eval = FALSE)
+### code chunk number 29: all-examples (eval = FALSE)
###################################################
-## data(package="pomp")
+## pompExample()
###################################################
Modified: www/vignettes/advanced_topics_in_pomp.Rnw
===================================================================
--- www/vignettes/advanced_topics_in_pomp.Rnw 2013-01-09 23:07:58 UTC (rev 808)
+++ www/vignettes/advanced_topics_in_pomp.Rnw 2013-01-10 00:23:21 UTC (rev 809)
@@ -90,12 +90,12 @@
We'll assume that each component of $X$ is measured independently and with the same error, $\tau$, so that the variance-covariance matrix of $Y_{t}\vert X_{t}$ has $\tau^2$ on the diagonal and zeros elsewhere.
An implementation of this model is included in the package as a \code{pomp} object;
-load it by executing \code{data(ou2)}.
+load it by executing \code{pompExample(ou2)}.
\subsection{An unvectorized implementation using \R\ code only}
Before we set about vectorizing the codes, let's have a look at what a plug-in based implementation written entirely in \R\ might look like.
<<plugin-R-code,echo=T,eval=T>>=
-data(ou2)
+pompExample(ou2)
ou2.dat <- as.data.frame(ou2)
pomp(
@@ -488,7 +488,7 @@
The \code{init.state} method is called to initialize the state (unobserved) process.
It takes a vector or matrix of parameters and returns a matrix of initial states.
<<>>=
-data(ou2)
+pompExample(ou2)
true.p <- coef(ou2)
x0 <- init.state(ou2)
x0
@@ -540,10 +540,10 @@
There are a number of example \code{pomp} objects included with the package.
These can be found by running
-<<all-data-loadable,eval=F>>=
-data(package="pomp")
+<<all-examples,eval=F>>=
+pompExample()
@
-The \R\ scripts that generated these are included in the \code{data-R} directory of the installed package.
+The \R\ scripts that generated these are included in the \code{examples} directory of the installed package.
The majority of these use compiled code, which can be found in the package source.
\section{Pomp Builder}
Modified: www/vignettes/advanced_topics_in_pomp.pdf
===================================================================
(Binary files differ)
Modified: www/vignettes/intro_to_pomp.R
===================================================================
--- www/vignettes/intro_to_pomp.R 2013-01-09 23:07:58 UTC (rev 808)
+++ www/vignettes/intro_to_pomp.R 2013-01-10 00:23:21 UTC (rev 809)
@@ -94,7 +94,7 @@
###################################################
### code chunk number 8: gompertz-get-data
###################################################
-data(gompertz)
+pompExample(gompertz)
dat <- as.data.frame(gompertz)
gompertz <- pomp(
data=dat[c("time","Y")],
@@ -359,7 +359,7 @@
###################################################
### code chunk number 37: intro_to_pomp.Rnw:608-611
###################################################
-data(gompertz)
+pompExample(gompertz)
theta <- coef(gompertz)
theta.true <- theta
@@ -630,7 +630,7 @@
###################################################
### code chunk number 52: get-ricker
###################################################
-data(ricker)
+pompExample(ricker)
###################################################
@@ -841,7 +841,7 @@
###################################################
### code chunk number 65: first-nlf (eval = FALSE)
###################################################
-## data(gompertz)
+## pompExample(gompertz)
## out <- nlf(
## gompertz,
## start=c(r=1,K=2,sigma=0.5,tau=0.5,X.0=1),
@@ -1314,7 +1314,7 @@
### code chunk number 87: bsmc-example-flat-prior-1
###################################################
require(pomp)
-data(ricker)
+pompExample(ricker)
###################################################
@@ -1342,7 +1342,7 @@
load(binary.file)
} else {
require(pomp)
-data(ricker)
+pompExample(ricker)
set.seed(136872209L)
Np <- 10000
prior1 <- parmat(coef(ricker),nrep=Np)
Modified: www/vignettes/intro_to_pomp.Rnw
===================================================================
--- www/vignettes/intro_to_pomp.Rnw 2013-01-09 23:07:58 UTC (rev 808)
+++ www/vignettes/intro_to_pomp.Rnw 2013-01-10 00:23:21 UTC (rev 809)
@@ -306,7 +306,7 @@
gompertz <- simulate(gompertz,params=theta)
@
<<gompertz-get-data,eval=T,echo=F>>=
-data(gompertz)
+pompExample(gompertz)
dat <- as.data.frame(gompertz)
gompertz <- pomp(
data=dat[c("time","Y")],
@@ -574,7 +574,7 @@
identical(coef(gompertz),coef(g2))
@
-A \code{pomp} object corresponding to the one just created (but with the \code{rprocess}, \code{rmeasure}, and \code{dmeasure} bits coded in C for speed) can be loaded by executing \verb+data(gompertz)+.
+A \code{pomp} object corresponding to the one just created (but with the \code{rprocess}, \code{rmeasure}, and \code{dmeasure} bits coded in C for speed) can be loaded by executing \verb+pompExample(gompertz)+.
For your convenience, codes creating this \code{pomp} object are included with the package.
To view them, run the demo
<<eval=F>>=
@@ -606,7 +606,7 @@
Let's use iterated filtering to obtain an approximate MLE for the data in \code{gompertz}.
We'll initialize the algorithm at several starting points around \code{theta.true} and just estimate the parameters $r$, $\tau$, and $\sigma$:
<<echo=F>>=
-data(gompertz)
+pompExample(gompertz)
theta <- coef(gompertz)
theta.true <- theta
@
@@ -872,7 +872,7 @@
Its \code{rprocess}, \code{rmeasure}, and \code{dmeasure} components are written in C and are thus a bit faster than the \R\ implementation above.
Do
<<get-ricker,echo=T,eval=T>>=
-data(ricker)
+pompExample(ricker)
@
to load this \code{pomp} object.
@@ -1060,7 +1060,7 @@
As a simple example we can use \code{nlf} to estimate the parameters \code{K} and \code{r} of the Gompertz model.
An example of a minimal call, accepting the defaults for all optional arguments, is
<<first-nlf,eval=F>>=
-data(gompertz)
+pompExample(gompertz)
out <- nlf(
gompertz,
start=c(r=1,K=2,sigma=0.5,tau=0.5,X.0=1),
@@ -1410,7 +1410,7 @@
Here, we'll use uniform priors on two model parameters ($\log{r}$ and $\sigma$), leaving the others fixed at their true values.
<<bsmc-example-flat-prior-1,echo=F,eval=T>>=
require(pomp)
-data(ricker)
+pompExample(ricker)
@
We'll use 10,000 particles, so we'll need that many samples from the prior distribution.
<<bsmc-example-flat-prior-2,eval=F>>=
Modified: www/vignettes/intro_to_pomp.pdf
===================================================================
(Binary files differ)
More information about the pomp-commits
mailing list