[Pomp-commits] r320 - in pkg: . src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Sep 24 12:24:05 CEST 2010


Author: kingaa
Date: 2010-09-24 12:24:05 +0200 (Fri, 24 Sep 2010)
New Revision: 320

Modified:
   pkg/DESCRIPTION
   pkg/src/pfilter.c
Log:
- bug fix


Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2010-09-23 21:55:56 UTC (rev 319)
+++ pkg/DESCRIPTION	2010-09-24 10:24:05 UTC (rev 320)
@@ -1,8 +1,8 @@
 Package: pomp
 Type: Package
 Title: Statistical inference for partially observed Markov processes
-Version: 0.32-6
-Date: 2010-09-20
+Version: 0.32-7
+Date: 2010-09-24
 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>

Modified: pkg/src/pfilter.c
===================================================================
--- pkg/src/pfilter.c	2010-09-23 21:55:56 UTC (rev 319)
+++ pkg/src/pfilter.c	2010-09-24 10:24:05 UTC (rev 320)
@@ -87,7 +87,11 @@
   }
 
   if (do_fm) {
-    PROTECT(fm = NEW_NUMERIC(nvars+npars)); nprotect++;
+    if (do_rw) {
+      PROTECT(fm = NEW_NUMERIC(nvars+npars)); nprotect++;
+    } else {
+      PROTECT(fm = NEW_NUMERIC(nvars)); nprotect++;
+    }
     xfm = REAL(fm);
   }
 
@@ -112,10 +116,10 @@
     //  compute filter mean
     if (do_fm) {
       if (all_fail) {
-	for (k = 0, ws = 0; k < nreps; k++) ws += xx[j+k*nvars];
+	for (k = 0, ws = 0; k < nreps; k++) ws += xx[j+k*nvars]; 
 	xfm[j] = ws/((double) nreps);
-      } else {
-	for (k = 0, ws = 0; k < nreps; k++) ws += xx[j+k*nvars]*xw[k];
+      } else { 
+	for (k = 0, ws = 0; k < nreps; k++) ws += xx[j+k*nvars]*xw[k]; 
 	xfm[j] = ws/w;
       }
     }



More information about the pomp-commits mailing list