[Pomp-commits] r671 - in pkg/pompExamples: . data inst inst/data-R inst/doc src tests
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Apr 21 16:00:13 CEST 2012
Author: kingaa
Date: 2012-04-21 16:00:12 +0200 (Sat, 21 Apr 2012)
New Revision: 671
Added:
pkg/pompExamples/inst/NEWS
Modified:
pkg/pompExamples/DESCRIPTION
pkg/pompExamples/data/budmoth.sim.rda
pkg/pompExamples/data/pertussis.sim.rda
pkg/pompExamples/inst/data-R/budmoth.sim.R
pkg/pompExamples/inst/doc/budmoth-model-slices.rda
pkg/pompExamples/inst/doc/budmoth-model-true-loglik.rda
pkg/pompExamples/inst/doc/pertussis-model-true-loglik.rda
pkg/pompExamples/src/budmoth.c
pkg/pompExamples/tests/budmoth.Rout.save
Log:
- changed the budmoth model t0 to -1. The data are changed as well.
Modified: pkg/pompExamples/DESCRIPTION
===================================================================
--- pkg/pompExamples/DESCRIPTION 2012-04-19 04:46:49 UTC (rev 670)
+++ pkg/pompExamples/DESCRIPTION 2012-04-21 14:00:12 UTC (rev 671)
@@ -1,8 +1,8 @@
Package: pompExamples
Type: Package
Title: Statistical inference for partially observed Markov processes
-Version: 0.20-1
-Date: 2012-04-18
+Version: 0.20-2
+Date: 2012-04-21
Author: NCEAS Working Group on Inference for Mechanistic Models: Aaron King, Steve Ellner, Bruce Kendall, Daniel C. Reuman, Matt Ferrari, Ed Ionides, Helen Wearing
Maintainer: Aaron A. King <kingaa at umich.edu>
Description: Inference methods for partially-observed Markov processes
Modified: pkg/pompExamples/data/budmoth.sim.rda
===================================================================
(Binary files differ)
Modified: pkg/pompExamples/data/pertussis.sim.rda
===================================================================
(Binary files differ)
Added: pkg/pompExamples/inst/NEWS
===================================================================
--- pkg/pompExamples/inst/NEWS (rev 0)
+++ pkg/pompExamples/inst/NEWS 2012-04-21 14:00:12 UTC (rev 671)
@@ -0,0 +1,8 @@
+NEWS
+0.21-1
+ o Changed t0 for the budmoth model from 0 to -1.
+ The data are different as well.
+
+0.20-1
+ o Ported these examples from 'pomp.devel'.
+ The data are not identical to those in 'pomp.devel', however.
Modified: pkg/pompExamples/inst/data-R/budmoth.sim.R
===================================================================
--- pkg/pompExamples/inst/data-R/budmoth.sim.R 2012-04-19 04:46:49 UTC (rev 670)
+++ pkg/pompExamples/inst/data-R/budmoth.sim.R 2012-04-21 14:00:12 UTC (rev 671)
@@ -24,7 +24,7 @@
Qobs=NA,Nobs=NA,Sobs=NA
),
time="time",
- t0=0,
+ t0=-1,
rprocess=euler.sim(
step.fun="budmoth_map",
delta.t=1,
Modified: pkg/pompExamples/inst/doc/budmoth-model-slices.rda
===================================================================
(Binary files differ)
Modified: pkg/pompExamples/inst/doc/budmoth-model-true-loglik.rda
===================================================================
(Binary files differ)
Modified: pkg/pompExamples/inst/doc/pertussis-model-true-loglik.rda
===================================================================
(Binary files differ)
Modified: pkg/pompExamples/src/budmoth.c
===================================================================
--- pkg/pompExamples/src/budmoth.c 2012-04-19 04:46:49 UTC (rev 670)
+++ pkg/pompExamples/src/budmoth.c 2012-04-21 14:00:12 UTC (rev 671)
@@ -36,6 +36,10 @@
#define NSTATE (x[stateindex[4]])
#define SSTATE (x[stateindex[5]])
+#define QOBS (y[obsindex[0]])
+#define NOBS (y[obsindex[1]])
+#define SOBS (y[obsindex[2]])
+
void budmoth_map (double *x, double *p,
int *stateindex, int *parindex, int *covindex,
int covdim, double *covar, double t, double dt)
@@ -74,16 +78,12 @@
f[stateindex[0]] = ALPHA; // ALPHA equation
f[stateindex[1]] = LAMBDA; // LAMBDA equation
f[stateindex[2]] = AEY; // A equation
- f[stateindex[3]] = (1-ALPHASTATE)*(GAM/(GAM+NSTATE))+ALPHASTATE*QSTATE; // Q equation
- f[stateindex[4]] = LAMBDASTATE*NSTATE*(1-SSTATE)*exp(-GEE*NSTATE-DELTA*(1-QSTATE)); // N equation
+ f[stateindex[3]] = (1-ALPHA)*(GAM/(GAM+NSTATE))+ALPHA*QSTATE; // Q equation
+ f[stateindex[4]] = LAMBDA*NSTATE*(1-SSTATE)*exp(-GEE*NSTATE-DELTA*(1-QSTATE)); // N equation
f[stateindex[5]] = 1-tol-exp(-(ASTATE*SSTATE*NSTATE+2*tol)/(1+DUBYA*ASTATE*SSTATE*NSTATE)); // S equation
}
-#define QOBS (y[obsindex[0]])
-#define NOBS (y[obsindex[1]])
-#define SOBS (y[obsindex[2]])
-
void budmoth_rmeasure (double *y, double *x, double *p,
int *obsindex, int *stateindex, int *parindex, int *covindex,
int ncovars, double *covars, double t) {
Modified: pkg/pompExamples/tests/budmoth.Rout.save
===================================================================
--- pkg/pompExamples/tests/budmoth.Rout.save 2012-04-19 04:46:49 UTC (rev 670)
+++ pkg/pompExamples/tests/budmoth.Rout.save 2012-04-21 14:00:12 UTC (rev 671)
@@ -1,5 +1,5 @@
-R version 2.15.0 (2012-03-30)
+R version 2.14.2 (2012-02-29)
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-unknown-linux-gnu (64-bit)
@@ -32,100 +32,97 @@
> print(lapply(x,tail))
$tri
time Qobs Nobs Sobs Q N S
-56 55 34.90777 1.3909427 8.760997e-07 0.9860433 1.0105838 1.109173e-06
-57 56 33.36428 5.9679756 3.009644e-06 0.9830185 17.7373560 2.949154e-06
-58 57 29.34035 68.3377210 7.255485e-05 0.8608373 80.4984855 8.681423e-05
-59 58 21.75336 1.2686716 8.552474e-03 0.6310693 0.7176525 9.751675e-03
-60 59 29.15848 0.3500365 1.047452e-02 0.8025905 0.3723865 1.256469e-02
-61 60 32.98213 1.6128525 6.718390e-03 0.8941107 1.0912736 7.410424e-03
+56 55 33.36428 5.9679756 3.009644e-06 0.9830185 17.7373560 2.949154e-06
+57 56 29.34035 68.3377210 7.255485e-05 0.8608373 80.4984855 8.681423e-05
+58 57 21.75336 1.2686716 8.552474e-03 0.6310693 0.7176525 9.751675e-03
+59 58 29.15848 0.3500365 1.047452e-02 0.8025905 0.3723865 1.256469e-02
+60 59 32.98213 1.6128525 6.718390e-03 0.8941107 1.0912736 7.410424e-03
+61 60 33.51183 13.0954506 1.173616e-02 0.9378258 7.6959192 1.147648e-02
Alpha Lambda A
-56 0.5246694 21.95700 1.813852
-57 0.4833379 21.87970 1.738908
-58 0.5010435 22.22843 1.640583
-59 0.5190030 22.45659 1.404177
-60 0.5165432 22.20828 1.810056
-61 0.5183574 22.01444 1.591250
+56 0.4833379 21.87970 1.738908
+57 0.5010435 22.22843 1.640583
+58 0.5190030 22.45659 1.404177
+59 0.5165432 22.20828 1.810056
+60 0.5183574 22.01444 1.591250
+61 0.4828455 22.35338 1.429722
$para1
time Qobs Nobs Sobs Q N S
-56 55 21.38207 0.68381238 0.907924733 0.6143380 0.55733084 0.997889584
-57 56 29.54776 0.02697955 0.430252439 0.8126219 0.02020849 0.573040310
-58 57 31.78574 0.07253569 0.020786180 0.9177534 0.17066444 0.022035629
-59 58 32.39154 2.81430772 0.005905631 0.9567875 3.49854944 0.005907819
-60 59 34.36420 63.29278180 0.031631312 0.9456880 56.35560023 0.033871059
-61 60 24.63131 17.42221294 0.790037174 0.7153921 12.65588781 0.871324054
+56 55 28.45210 0.01658405 0.498973510 0.8126219 0.02020849 0.573040310
+57 56 32.58924 0.27733546 0.018765592 0.9177534 0.17066444 0.022035629
+58 57 33.73454 5.79328447 0.005823772 0.9567875 3.49854944 0.005907819
+59 58 33.57238 46.79128317 0.030243114 0.9456880 56.35560023 0.033871059
+60 59 25.61890 7.50489123 0.791479385 0.7153921 12.65588781 0.871324054
+61 60 26.46555 8.12880629 0.894923272 0.7569961 11.25818628 0.992799332
Alpha Lambda A
-56 0.5031487 22.14524 1.579994
-57 0.4707325 21.78521 1.754212
-58 0.4377213 21.75771 1.930505
-59 0.5049253 22.14170 1.576733
-60 0.4996302 21.90574 1.675765
-61 0.5157446 21.68244 1.551352
+56 0.4707325 21.78521 1.754212
+57 0.4377213 21.75771 1.930505
+58 0.5049253 22.14170 1.576733
+59 0.4996302 21.90574 1.675765
+60 0.5157446 21.68244 1.551352
+61 0.4964261 21.93769 1.721177
$food
- time Qobs Nobs Sobs Q N S
-56 55 34.13985 16.01354997 3.224917e-06 0.9529645 7.4387892 3.827248e-06
-57 56 27.79192 22.28079514 2.070576e-05 0.8502012 19.7570009 2.570550e-05
-58 57 24.07011 31.94991132 4.869824e-04 0.6794912 14.4355348 5.305078e-04
-59 58 21.81314 1.77819709 7.707581e-03 0.6288764 1.9239332 7.967758e-03
-60 59 27.66444 0.24999819 1.516026e-02 0.7899212 0.1973302 1.416005e-02
-61 60 28.79342 0.09924733 2.128647e-03 0.8898312 0.1200628 3.272257e-03
+ time Qobs Nobs Sobs Q N S
+56 55 28.90370 20.4806075 2.870679e-05 0.8502012 19.7570009 0.0000257055
+57 56 25.04577 17.2422706 4.340917e-04 0.6794912 14.4355348 0.0005305078
+58 57 21.68427 2.1931554 7.856243e-03 0.6288764 1.9239332 0.0079677582
+59 58 27.25406 0.3103408 1.348361e-02 0.7899212 0.1973302 0.0141600465
+60 59 32.38417 0.1216027 3.499077e-03 0.8898312 0.1200628 0.0032722573
+61 60 32.80127 0.1632687 3.512564e-04 0.9346055 0.1908352 0.0003751743
Alpha Lambda A
-56 0.5153850 4.617116 1.0869780
-57 0.5413771 4.932935 0.8677828
-58 0.5082460 4.851747 1.0428964
-59 0.4871643 4.388592 1.0444642
-60 0.4316777 4.394991 0.9302542
-61 0.5012195 5.063878 1.1726507
+56 0.5413771 4.932935 0.8677828
+57 0.5082460 4.851747 1.0428964
+58 0.4871643 4.388592 1.0444642
+59 0.4316777 4.394991 0.9302542
+60 0.5012195 5.063878 1.1726507
+61 0.5703106 4.810311 0.9525775
$para2
time Qobs Nobs Sobs Q N S
-56 55 33.68890 3.458362 1.054469e-06 0.9845993 1.799560 1.225629e-06
-57 56 33.87640 15.747819 2.248998e-06 0.9749960 6.921067 2.575005e-06
-58 57 33.94564 50.157117 1.166632e-05 0.9265344 33.878434 1.350848e-05
-59 58 26.54568 39.257279 7.764646e-04 0.7668865 21.145329 1.028206e-03
-60 59 25.06245 37.080107 1.942558e-02 0.7334130 32.430161 2.124212e-02
-61 60 24.65754 10.630755 8.364070e-01 0.6707489 14.812001 9.357010e-01
+56 55 33.87640 15.747819 2.248998e-06 0.9749960 6.921067 2.575005e-06
+57 56 33.94564 50.157117 1.166632e-05 0.9265344 33.878434 1.350848e-05
+58 57 26.54568 39.257279 7.764646e-04 0.7668865 21.145329 1.028206e-03
+59 58 25.06245 37.080107 1.942558e-02 0.7334130 32.430161 2.124212e-02
+60 59 24.65754 10.630755 8.364070e-01 0.6707489 14.812001 9.357010e-01
+61 60 26.63838 2.623661 8.898155e-01 0.7198956 2.691147 9.968919e-01
Alpha Lambda A
-56 0.5199566 23.368648 2.8482104
-57 0.5034550 4.475840 0.7140993
-58 0.4982577 8.622703 0.7018725
-59 0.5168533 9.734355 2.2460464
-60 0.4777904 9.364085 0.9906918
-61 0.5059549 7.138668 6.7705675
+56 0.5034550 4.475840 0.7140993
+57 0.4982577 8.622703 0.7018725
+58 0.5168533 9.734355 2.2460464
+59 0.4777904 9.364085 0.9906918
+60 0.5059549 7.138668 6.7705675
+61 0.5120129 10.895242 3.1116150
>
> y <- simulate(budmoth.sim$food,seed=3434996L,as.data.frame=TRUE)
> tail(y)
time Qobs Nobs Sobs Q N S
-56 55 21.60813 9.9416747 0.0084565260 0.6260519 6.6374470 0.0094829150
-57 56 23.69758 0.4068012 0.0555572562 0.6960924 0.6909030 0.0655207892
-58 57 27.36280 0.1056701 0.0461785098 0.8328430 0.1516087 0.0367590933
-59 58 31.64283 0.2311652 0.0054429206 0.9128312 0.1262158 0.0061363639
-60 59 33.07830 0.2439202 0.0007323085 0.9501525 0.2684836 0.0007689092
-61 60 34.70798 0.4126931 0.0001924636 0.9684718 0.8167865 0.0002084246
+56 55 24.75707 1.2571930 0.0536837100 0.6960924 0.6909030 0.0655207892
+57 56 29.35042 0.2081742 0.0312580513 0.8328430 0.1516087 0.0367590933
+58 57 29.68381 0.1063595 0.0058573296 0.9128312 0.1262158 0.0061363639
+59 58 33.43385 0.6853961 0.0007332514 0.9501525 0.2684836 0.0007689092
+60 59 32.70001 1.8683455 0.0002049072 0.9684718 0.8167865 0.0002084246
+61 60 33.33550 1.4268639 0.0001321697 0.9644772 2.9148822 0.0001579051
Alpha Lambda A sim
-56 0.4538116 5.723480 1.0150383 1
-57 0.4386467 5.049427 1.0766197 1
-58 0.4944825 4.972702 0.8273030 1
-59 0.4989262 4.612384 1.1043024 1
-60 0.5386598 5.130300 0.9918653 1
-61 0.4994891 5.038971 1.0048781 1
+56 0.4386467 5.049427 1.0766197 1
+57 0.4944825 4.972702 0.8273030 1
+58 0.4989262 4.612384 1.1043024 1
+59 0.5386598 5.130300 0.9918653 1
+60 0.4994891 5.038971 1.0048781 1
+61 0.4818151 4.973050 0.9217527 1
>
> z <- trajectory(budmoth.sim$tri,as.data.frame=TRUE)
> tail(z)
- Q N S Alpha Lambda A time traj
-56 1 0 9.99998e-07 0.5 22 1.7 55 1
-57 1 0 9.99998e-07 0.5 22 1.7 56 1
-58 1 0 9.99998e-07 0.5 22 1.7 57 1
-59 1 0 9.99998e-07 0.5 22 1.7 58 1
-60 1 0 9.99998e-07 0.5 22 1.7 59 1
-61 1 0 9.99998e-07 0.5 22 1.7 60 1
+ Q N S Alpha Lambda A time traj
+56 0.9795835 16.9946885 0.0001199655 0.5 22 1.7 55 1
+57 0.8629557 78.2636478 0.0034591173 0.5 22 1.7 56 1
+58 0.6263889 0.8320401 0.3498223901 0.5 22 1.7 57 1
+59 0.8050102 0.2655329 0.3691104688 0.5 22 1.7 58 1
+60 0.8998638 0.5133800 0.1500321097 0.5 22 1.7 59 1
+61 0.9448503 3.3848665 0.1205147616 0.5 22 1.7 60 1
>
> pf <- pfilter(budmoth.sim$food,seed=34348885L,Np=1000)
> logLik(pf)
-[1] 355.9053
+[1] 360.1747
>
-> proc.time()
- user system elapsed
- 0.564 0.020 0.602
More information about the pomp-commits
mailing list