[Pomp-commits] r1057 - in pkg/pompExamples: . vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jan 26 02:27:50 CET 2015


Author: kingaa
Date: 2015-01-26 02:27:50 +0100 (Mon, 26 Jan 2015)
New Revision: 1057

Modified:
   pkg/pompExamples/DESCRIPTION
   pkg/pompExamples/vignettes/parus-tm1.rds
   pkg/pompExamples/vignettes/parus.Rmd
   pkg/pompExamples/vignettes/parus.html
Log:
- update

Modified: pkg/pompExamples/DESCRIPTION
===================================================================
--- pkg/pompExamples/DESCRIPTION	2015-01-24 15:19:51 UTC (rev 1056)
+++ pkg/pompExamples/DESCRIPTION	2015-01-26 01:27:50 UTC (rev 1057)
@@ -1,7 +1,7 @@
 Package: pompExamples
 Type: Package
 Title: Additional pomp examples
-Version: 0.26-2
+Version: 0.26-3
 Date: 2015-01-24
 Maintainer: Aaron A. King <kingaa at umich.edu>
 Authors at R: c(person(given=c("Aaron","A."),family="King",role=c("aut","cre"),

Modified: pkg/pompExamples/vignettes/parus-tm1.rds
===================================================================
--- pkg/pompExamples/vignettes/parus-tm1.rds	2015-01-24 15:19:51 UTC (rev 1056)
+++ pkg/pompExamples/vignettes/parus-tm1.rds	2015-01-26 01:27:50 UTC (rev 1057)
@@ -1 +1,2 @@
-‹      ‹àb```b`fdb`b2™…;ó1あ;§³Ç}‚ñ ÌwÈØÿÿä)8ßíñGÎõ‰«a|ûe+ìÍgY߁ñë?€´²/‚«OªÿÿX˜Àæ³0piÖ¼ÄÜÔb C ìˆ [N~zNf6”Ç	áé§B½aŒ"˜)ř鹉0NIFj	ŒÃì§g€f%gQ~¹ÌZ^P˜4 	ãÐÝ–œ“XsL+%±$Q/­¨Èû T­¾U  
\ No newline at end of file
+‹      ‹àb```b`fdb`b2™…;ó1あ;§³Ç}†ñ ÌwÈ8ÀÀ°eB<œt8Z]@¥—úú &û"¸ú¤úÿ@ð…	¬ž…H³æ%æ¦`Ç@ÙròÓs2³¡<NO¯8*Àè
+cÁL)ÎLÏM„qJ2RK`f?=4+9‹òËõ`Öò‚¤H€‡î¶äœÄb˜Û`‚\)‰%‰ziE@ý@Þ?  ˆh…U  
\ No newline at end of file

Modified: pkg/pompExamples/vignettes/parus.Rmd
===================================================================
--- pkg/pompExamples/vignettes/parus.Rmd	2015-01-24 15:19:51 UTC (rev 1056)
+++ pkg/pompExamples/vignettes/parus.Rmd	2015-01-26 01:27:50 UTC (rev 1057)
@@ -50,17 +50,46 @@
 ```{r}
 pompExample(parus,proc='Gompertz',meas='Poisson')
 plot(parus)
+```
+
+## Model description
+
+### Process model
+
+If `proc="Gompertz"`, then the population size, $N_t$ follows the stochastic Gompertz model
+$$N_{t} = K^{1-S}\,N_{t-1}^S\,\epsilon_t,$$
+where $S=e^r$ and $\epsilon_t\stackrel{i.i.d.}{\sim}\mathrm{Lognormal}(0,\sigma)$.
+
+If `proc="Ricker"`, the state process is the stochastic Ricker model
+$$N_{t} = N_{t-1}\,\exp\left(r\,\left(1-\frac{N_{t-1}}{K}\right)\right)\,\epsilon_t,$$
+where, again, $\epsilon_t\stackrel{i.i.d.}{\sim}\mathrm{Lognormal}(0,\sigma)$.
+
+### Measurement model
+
+There are three alternative measurement models.
+
+If `meas="Poisson"`, the measurement process is
+$$\mathrm{pop}_{t} \sim \mathrm{Poisson}(N_t).$$
+
+If `meas="negbin"`, the measurement process is
+$$\mathrm{pop}_{t} \sim \mathrm{Negbin}(N_t,\theta),$$
+i.e., $\mathrm{pop}_t$ has mean $N_t$ and variance $N_t+\frac{N_t^2}{\theta}$.
+
+If `meas="lognormal"`, the measurement process is
+$$\mathrm{pop}_{t} \sim \mathrm{Lognormal}(\log(N_t),\theta).$$
+
+```{r}
 coef(parus)
-logLik(traj.match(parus))
 ```
 
 ## Trajectory matching
 
 ```{r}
+logLik(traj.match(parus))
 juliaChild("parus-tm1.rds",{
   tm <- parus
-  coef(tm,"theta") <- NA
-  traj.match(tm,est=c("K","r","sigma"),transform=T) -> tm
+  coef(tm,c("sigma","theta")) <- c(0,NA)
+  traj.match(tm,est=c("K","r"),transform=T) -> tm
   traj.match(tm,method='subplex') -> tm
   data.frame(loglik=logLik(tm),loglik.se=0,as.list(coef(tm)))
   }) -> tm
@@ -69,7 +98,9 @@
 ggplot(data=simulate(parus,params=unlist(tm),nsim=10,obs=TRUE,
                      as.data.frame=TRUE,include.data=TRUE),
        mapping=aes(x=time,y=pop,group=sim,alpha=sim=="data"))+
-  geom_line()
+  geom_line()+
+  scale_alpha_manual(name="",labels=c(`TRUE`='data',`FALSE`='simulation'),
+                     values=c(`TRUE`=1,`FALSE`=0.2))
 ```
 
 ## Iterated filtering
@@ -91,17 +122,19 @@
   plot(mf)
   ll <- unname(logmeanexp(raply(5,logLik(pfilter(mf))),se=TRUE))
   data.frame(loglik=ll[1],loglik.se=ll[2],as.list(coef(mf)))
-}) -> mf
+  }) -> mf
 ```
 ```{r}
 ggplot(data=simulate(parus,params=unlist(mf),nsim=10,obs=TRUE,
                      as.data.frame=TRUE,include.data=TRUE),
        mapping=aes(x=time,y=pop,group=sim,alpha=sim=="data"))+
-  geom_line()
+  geom_line()+
+  scale_alpha_manual(name="",labels=c(`TRUE`='data',`FALSE`='simulation'),
+                     values=c(`TRUE`=1,`FALSE`=0.2))
 ```
 
 ## Comparison
 
 ```{r}
-kable(ldply(list(det=tm,stoch=mf),.id='model'))
+kable(ldply(list(det.gomp.poisson=tm,stoch.gomp.poisson=mf),.id='model'))
 ```

Modified: pkg/pompExamples/vignettes/parus.html
===================================================================
--- pkg/pompExamples/vignettes/parus.html	2015-01-24 15:19:51 UTC (rev 1056)
+++ pkg/pompExamples/vignettes/parus.html	2015-01-26 01:27:50 UTC (rev 1057)
@@ -82,26 +82,43 @@
 ##  parus</code></pre>
 <pre class="r"><code>plot(parus)</code></pre>
[TRUNCATED]

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


More information about the pomp-commits mailing list