[Pomp-commits] r796 - branches/mif2/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jan 8 12:09:58 CET 2013


Author: kingaa
Date: 2013-01-08 12:09:58 +0100 (Tue, 08 Jan 2013)
New Revision: 796

Added:
   branches/mif2/R/pomp-class.R
Modified:
   branches/mif2/R/pomp.R
Log:
- as in main trunk


Added: branches/mif2/R/pomp-class.R
===================================================================
--- branches/mif2/R/pomp-class.R	                        (rev 0)
+++ branches/mif2/R/pomp-class.R	2013-01-08 11:09:58 UTC (rev 796)
@@ -0,0 +1,47 @@
+## as of version 0.37-1 'pomp' is a generic function
+setGeneric("pomp",function(data,...)standardGeneric("pomp"))
+
+## this is the initial-condition setting function that is used by default
+## it simply finds all parameters in the vector 'params' that have a name ending in '.0'
+## and returns a vector with their values with names stripped of '.0'
+default.initializer <- function (params, t0, ...) {
+  ivpnames <- grep("\\.0$",names(params),value=TRUE)
+  if (length(ivpnames)<1)
+    stop("default initializer error: no parameter names ending in ",
+         sQuote(".0")," found: see ",sQuote("pomp")," documentation")
+  x <- params[ivpnames]
+  names(x) <- sub("\\.0$","",ivpnames)
+  x
+}
+
+## define the pomp class
+setClass(
+         'pomp',
+         representation=representation(
+           data = 'array',
+           times = 'numeric',
+           t0 = 'numeric',
+           rprocess = 'function',
+           dprocess = 'function',
+           dmeasure = 'pomp.fun',
+           rmeasure = 'pomp.fun',
+           skeleton.type = 'character',
+           skeleton = 'pomp.fun',
+           skelmap.delta.t = 'numeric',
+           initializer = 'function',
+           states = 'array',
+           params = 'numeric',
+           covar = 'matrix',
+           tcovar = 'numeric',
+           obsnames = 'character',
+           statenames = 'character',
+           paramnames = 'character',
+           covarnames = 'character',
+           zeronames = 'character',
+           has.trans = 'logical',
+           par.trans = 'pomp.fun',
+           par.untrans = 'pomp.fun',
+           PACKAGE = 'character',
+           userdata = 'list'
+           )
+         )

Modified: branches/mif2/R/pomp.R
===================================================================
--- branches/mif2/R/pomp.R	2013-01-08 11:06:53 UTC (rev 795)
+++ branches/mif2/R/pomp.R	2013-01-08 11:09:58 UTC (rev 796)
@@ -1,50 +1,3 @@
-## define the pomp class
-setClass(
-         'pomp',
-         representation(
-                        data = 'array',
-                        times = 'numeric',
-                        t0 = 'numeric',
-                        rprocess = 'function',
-                        dprocess = 'function',
-                        dmeasure = 'pomp.fun',
-                        rmeasure = 'pomp.fun',
-                        skeleton.type = 'character',
-                        skeleton = 'pomp.fun',
-                        skelmap.delta.t = 'numeric',
-                        initializer = 'function',
-                        states = 'array',
-                        params = 'numeric',
-                        covar = 'matrix',
-                        tcovar = 'numeric',
-                        obsnames = 'character',
-                        statenames = 'character',
-                        paramnames = 'character',
-                        covarnames = 'character',
-                        zeronames = 'character',
-                        has.trans = 'logical',
-                        par.trans = 'pomp.fun',
-                        par.untrans = 'pomp.fun',
-                        PACKAGE = 'character',
-                        userdata = 'list'
-                        )
-         )
-
-## this is the initial-condition setting function that is used by default
-## it simply finds all parameters in the vector 'params' that have a name ending in '.0'
-## and returns a vector with their values with names stripped of '.0'
-default.initializer <- function (params, t0, ...) {
-  ivpnames <- grep("\\.0$",names(params),value=TRUE)
-  if (length(ivpnames)<1)
-    stop("default initializer error: no parameter names ending in ",sQuote(".0")," found: see ",sQuote("pomp")," documentation")
-  x <- params[ivpnames]
-  names(x) <- sub("\\.0$","",ivpnames)
-  x
-}
-
-## as of version 0.37-1 'pomp' is a generic function
-setGeneric("pomp",function(data,...)standardGeneric("pomp"))
-
 ## basic constructor of the pomp class
 pomp.constructor <- function (data, times, t0, ..., rprocess, dprocess,
                               rmeasure, dmeasure, measurement.model,



More information about the pomp-commits mailing list