[Pomp-commits] r518 - in pkg: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jun 30 17:27:17 CEST 2011


Author: kingaa
Date: 2011-06-30 17:27:17 +0200 (Thu, 30 Jun 2011)
New Revision: 518

Modified:
   pkg/DESCRIPTION
   pkg/R/spect.R
Log:
- fix 'spect' so that the frequencies reflect the timescale of observation


Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2011-06-29 18:56:18 UTC (rev 517)
+++ pkg/DESCRIPTION	2011-06-30 15:27:17 UTC (rev 518)
@@ -1,8 +1,8 @@
 Package: pomp
 Type: Package
 Title: Statistical inference for partially observed Markov processes
-Version: 0.38-4
-Date: 2011-06-30
+Version: 0.38-5
+Date: 2011-07-01
 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>
 URL: http://pomp.r-forge.r-project.org

Modified: pkg/R/spect.R
===================================================================
--- pkg/R/spect.R	2011-06-29 18:56:18 UTC (rev 517)
+++ pkg/R/spect.R	2011-06-30 15:27:17 UTC (rev 518)
@@ -62,6 +62,7 @@
   if (any(is.na(dat)))
     stop(sQuote("spect")," is incompatible with NAs in the data")
   dt <- diff(time(object,t0=FALSE))
+  base.freq <- 1/mean(dt)
   dt.tol <- 0.025
   if (max(dt)-min(dt)>dt.tol*mean(dt))
     stop(sQuote("spect")," assumes evenly spaced times")
@@ -79,7 +80,7 @@
                      plot=FALSE
                      )
     if (j==1) {
-      freq <- sp$freq
+      freq <- base.freq*sp$freq
       datspec <- array(
                        dim=c(length(freq),nrow(dat)),
                        dimnames=list(NULL,vars)



More information about the pomp-commits mailing list