[Pomp-commits] r1049 - in pkg/pomp: . R src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Jan 10 13:36:12 CET 2015


Author: kingaa
Date: 2015-01-10 13:36:12 +0100 (Sat, 10 Jan 2015)
New Revision: 1049

Modified:
   pkg/pomp/DESCRIPTION
   pkg/pomp/R/pfilter.R
   pkg/pomp/src/pfilter.c
Log:
- attach names to dimnames of states and parameter arrays in pfilter computations

Modified: pkg/pomp/DESCRIPTION
===================================================================
--- pkg/pomp/DESCRIPTION	2015-01-09 13:03:03 UTC (rev 1048)
+++ pkg/pomp/DESCRIPTION	2015-01-10 12:36:12 UTC (rev 1049)
@@ -1,8 +1,8 @@
 Package: pomp
 Type: Package
 Title: Statistical Inference for Partially Observed Markov Processes
-Version: 0.58-3
-Date: 2015-01-09
+Version: 0.58-4
+Date: 2015-01-10
 Authors at R: c(person(given=c("Aaron","A."),family="King",
 		role=c("aut","cre"),email="kingaa at umich.edu"),
 	  person(given=c("Edward","L."),family="Ionides",role=c("aut")),

Modified: pkg/pomp/R/pfilter.R
===================================================================
--- pkg/pomp/R/pfilter.R	2015-01-09 13:03:03 UTC (rev 1048)
+++ pkg/pomp/R/pfilter.R	2015-01-10 12:36:12 UTC (rev 1049)
@@ -301,10 +301,12 @@
     
     if (save.states) {
       xparticles[[nt]] <- x
+      dimnames(xparticles[[nt]]) <- setNames(dimnames(xparticles[[nt]]),c("variable","rep"))
     }
     
     if (save.params) {
       pparticles[[nt]] <- params
+      dimnames(pparticles[[nt]]) <- setNames(dimnames(pparticles[[nt]]),c("variable","rep"))
     }
     
     if (verbose && (nt%%5==0))

Modified: pkg/pomp/src/pfilter.c
===================================================================
--- pkg/pomp/src/pfilter.c	2015-01-09 13:03:03 UTC (rev 1048)
+++ pkg/pomp/src/pfilter.c	2015-01-10 12:36:12 UTC (rev 1049)
@@ -59,6 +59,7 @@
   SEXP rw_names, ess, fail, loglik;
   SEXP newstates = R_NilValue, newparams = R_NilValue;
   SEXP retval, retvalnames;
+  const char *dimnm[2] = {"variable","rep"};
   double *xpm = 0, *xpv = 0, *xfm = 0, *xw = 0, *xx = 0, *xp = 0;
   SEXP dimX, dimP, newdim, Xnames, Pnames, pindex;
   int *dim, *pidx, lv, np;
@@ -225,6 +226,7 @@
     xdim[0] = nvars; xdim[1] = np;
     PROTECT(newstates = makearray(2,xdim)); nprotect++;
     setrownames(newstates,Xnames,2);
+    fixdimnames(newstates,dimnm,2);
     ss = REAL(x);
     st = REAL(newstates);
 
@@ -233,6 +235,7 @@
       xdim[0] = npars; xdim[1] = np;
       PROTECT(newparams = makearray(2,xdim)); nprotect++;
       setrownames(newparams,Pnames,2);
+      fixdimnames(newparams,dimnm,2);
       ps = REAL(params);
       pt = REAL(newparams);
     }
@@ -255,6 +258,7 @@
     dim[0] = nvars; dim[1] = nreps;
     SET_DIM(x,newdim);
     setrownames(x,Xnames,2);
+    fixdimnames(x,dimnm,2);
 
   }
 



More information about the pomp-commits mailing list