[Pomp-commits] r1124 - / www/vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Mar 1 17:53:04 CET 2015


Author: kingaa
Date: 2015-03-01 17:53:04 +0100 (Sun, 01 Mar 2015)
New Revision: 1124

Removed:
   trigger_build
Modified:
   www/vignettes/getting_started.R
   www/vignettes/getting_started.Rmd
   www/vignettes/getting_started.html
Log:
- another small tweak

Deleted: trigger_build
===================================================================
Modified: www/vignettes/getting_started.R
===================================================================
--- www/vignettes/getting_started.R	2015-03-01 16:38:26 UTC (rev 1123)
+++ www/vignettes/getting_started.R	2015-03-01 16:53:04 UTC (rev 1124)
@@ -94,7 +94,7 @@
 step.fun <- Csnippet("
   double dW = rnorm(0,sqrt(dt));
   N += r*N*(1-N/K)*dt+sigma*N*dW;
-  ")
+")
 
 ## ----logistic-pomp1,cache=FALSE------------------------------------------
 parus <- pomp(data=parus.dat,time="year",t0=1959,
@@ -114,7 +114,7 @@
 ## ----logistic-rmeasure---------------------------------------------------
 rmeas <- Csnippet("
   pop = rpois(phi*N);
-  ")
+")
 
 ## ----logistic-pomp2,cache=FALSE------------------------------------------
 parus <- pomp(parus,rmeasure=rmeas,paramnames="phi",statenames="N")
@@ -139,7 +139,7 @@
 ## ----logistic-dmeasure---------------------------------------------------
 dmeas <- Csnippet("
   lik = dpois(pop,phi*N,give_log);
-  ")
+")
 
 ## ----logistic-pomp3,cache=FALSE------------------------------------------
 parus <- pomp(parus,dmeasure=dmeas,paramnames="phi",statenames="N")
@@ -151,7 +151,7 @@
 ## ----logistic-skeleton,cache=FALSE---------------------------------------
 skel <- Csnippet("
   DN = r*N*(1-N/K);
-  ")
+")
 
 parus <- pomp(parus,skeleton=skel,skeleton.type="vectorfield",statenames="N",paramnames=c("r","K"))
 
@@ -170,12 +170,12 @@
 bh.step <- Csnippet("
   double eps = rlnorm(-sigma*sigma/2,sigma);
   N = a*N/(1+b*N)*eps;
-  ")
+")
 
 ## ----bh-skeleton---------------------------------------------------------
 bh.skel <- Csnippet("
   DN = a*N/(1+b*N);
-  ")
+")
 
 ## ----bh-pomp1,cache=FALSE------------------------------------------------
 parus.bh <- pomp(parus,rprocess=discrete.time.sim(bh.step,delta.t=1),skeleton=bh.skel,skeleton.type="map",skelmap.delta.t=1,statenames="N",paramnames=c("a","b","sigma"))
@@ -190,12 +190,12 @@
 partrans <- Csnippet("
   Tr = exp(r);
   TK = exp(K);
-  ")
+")
 
 parinvtrans <- Csnippet("
   Tr = log(r);
   TK = log(K);
-  ")
+")
 
 parus <- pomp(parus,parameter.transform=partrans,parameter.inv.transform=parinvtrans,
               paramnames=c("r","K"))

Modified: www/vignettes/getting_started.Rmd
===================================================================
--- www/vignettes/getting_started.Rmd	2015-03-01 16:38:26 UTC (rev 1123)
+++ www/vignettes/getting_started.Rmd	2015-03-01 16:53:04 UTC (rev 1124)
@@ -83,18 +83,21 @@
 We will illustrate this using some simple examples.
 
 -----------------------------------
-![schematic1](../graphics/pomp_schematic1.png)
 
-Schematic of the structure of a POMP showing causal relations and direction of information flow.
+The following is a schematic of the structure of a POMP showing causal relations between the process model, the measurement model, and the data.
 **The key perspective to keep in mind is that the model is to be viewed as the process that generated the data.**
 
+![schematic1](../graphics/pomp_schematic1.png)
+
 -----------------------------------
+
+Here is another POMP model schematic, showing dependence among model variables.
+
 ![schematic2](../graphics/pomp_schematic2.png)
 
-Another POMP model schematic, showing dependence among model variables.
-State variables, $x$, at time $t$ depend only on state variables at the previous timestep.
-Measurements, $y$, at time $t$ depend only on the state at that time.
-Formally, $\mathrm{Prob}[X_t|X_1,\dots,X_{t-1},Y_1,\dots,Y_{t-1}]=\mathrm{Prob}[X_t|X_{t-1}]$ and $\mathrm{Prob}[Y_t|X_1,\dots,X_{t},Y_1,\dots,Y_{t-1}]=\mathrm{Prob}[Y_t|X_{t}]$ for all $t=1,\dots,T$.
+State variables, $X$, at time $t$ depend only on state variables at the previous timestep.
+Measurements, $Y$, at time $t$ depend only on the state at that time.
+Formally, $$\mathrm{Prob}[X_t|X_0,\dots,X_{t-1},Y_1,\dots,Y_{t-1}]=\mathrm{Prob}[X_t|X_{t-1}]$$ and $$\mathrm{Prob}[Y_t|X_0,\dots,X_{t},Y_1,\dots,Y_{t-1}]=\mathrm{Prob}[Y_t|X_{t}],$$ for all $t=1,\dots,T$.
 
 -----------------------------------
 
@@ -209,7 +212,7 @@
 step.fun <- Csnippet("
   double dW = rnorm(0,sqrt(dt));
   N += r*N*(1-N/K)*dt+sigma*N*dW;
-  ")
+")
 ```
 
 This is just a snippet of C code: not all the variables are declared and the context of the snippet is not specified.
@@ -259,7 +262,7 @@
 ```{r logistic-rmeasure}
 rmeas <- Csnippet("
   pop = rpois(phi*N);
-  ")
+")
 ```
 In this snippet of code, `N` is the state variable, `phi` is another parameter, and `pop` is the name of our observable, as defined in the dataset `parus.dat`.
 The `rpois` function is part of the [`R` API](http://cran.r-project.org/doc/manuals/r-release/R-exts.html#The-R-API): it takes a single argument---the Poisson distribution's parameter---and returns a pseudo-random draw from the Poisson distribution with that parameter.
@@ -295,7 +298,7 @@
 ```{r logistic-dmeasure}
 dmeas <- Csnippet("
   lik = dpois(pop,phi*N,give_log);
-  ")
+")
 ```
 and we fold it into the `pomp` object via
 ```{r logistic-pomp3,cache=FALSE}
@@ -324,7 +327,7 @@
 ```{r logistic-skeleton,cache=FALSE}
 skel <- Csnippet("
   DN = r*N*(1-N/K);
-  ")
+")
 
 parus <- pomp(parus,skeleton=skel,skeleton.type="vectorfield",statenames="N",paramnames=c("r","K"))
 ```
@@ -357,14 +360,14 @@
 bh.step <- Csnippet("
   double eps = rlnorm(-sigma*sigma/2,sigma);
   N = a*N/(1+b*N)*eps;
-  ")
+")
 ```
 A corresponding skeleton is the deterministic Beverton-Holt map obtained by setting $e_t=1$ in the above equation.
 A snippet that implements this map is
 ```{r bh-skeleton}
 bh.skel <- Csnippet("
   DN = a*N/(1+b*N);
-  ")
+")
 ```
 Note that, as in the continuous case, we indicate the new value of the state variable by prepending `D` to the variable name.
 
@@ -388,12 +391,12 @@
 partrans <- Csnippet("
   Tr = exp(r);
   TK = exp(K);
-  ")
+")
 
 parinvtrans <- Csnippet("
   Tr = log(r);
   TK = log(K);
-  ")
+")
 
 parus <- pomp(parus,parameter.transform=partrans,parameter.inv.transform=parinvtrans,
               paramnames=c("r","K"))

Modified: www/vignettes/getting_started.html
===================================================================
--- www/vignettes/getting_started.html	2015-03-01 16:38:26 UTC (rev 1123)
+++ www/vignettes/getting_started.html	2015-03-01 16:53:04 UTC (rev 1124)
@@ -95,24 +95,14 @@
 <li>we might wish to <em>evaluate the density</em> itself at given values of <span class="math">\(X_t\)</span> and/or <span class="math">\(Y_t\)</span>.</li>
 </ol>
 <p>We refer to the simulation of <span class="math">\(f_{X_t|X_{t-1}}\)</span> as the <em>rprocess</em> component of the POMP model, the evaluation of <span class="math">\(f_{X_t|X_{t-1}}\)</span> as the <em>dprocess</em> component, the simulation of <span class="math">\(f_{Y_t|X_t}\)</span>, as the <em>rmeasure</em> component, and the evaluation of <span class="math">\(f_{Y_t|X_t}\)</span> as the <em>dmeasure</em> component. Methods that make no use of the <em>dprocess</em> component are called “plug-and-play” methods. At present, <code>pomp</code> is focused on such methods, so there is no reason to focus on the dprocess component any further. In the following, we will illustrate and explain how one specifies the rprocess, rmeasure, and dmeasure components of a model in <code>pomp</code>. We will illustrate this using some simple examples.</p>
-<table>
-<colgroup>
-<col width="48%"></col>
-</colgroup>
-<thead>
-<tr class="header">
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/pomp -r 1124


More information about the pomp-commits mailing list