[Pomp-commits] r456 - in pkg: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed May 4 23:33:27 CEST 2011


Author: kingaa
Date: 2011-05-04 23:33:27 +0200 (Wed, 04 May 2011)
New Revision: 456

Added:
   pkg/R/pfilter-methods.R
   pkg/man/pfilter-methods.Rd
Modified:
   pkg/R/aaa.R
   pkg/R/mif-methods.R
   pkg/R/pfilter.R
   pkg/man/mif-methods.Rd
   pkg/man/pfilter.Rd
Log:
- 'pred.mean', 'pred.var', and 'filter.mean' methods are now defined for 'pfilterd.pomp' objects (and not just 'mif' objects)


Modified: pkg/R/aaa.R
===================================================================
--- pkg/R/aaa.R	2011-05-04 21:32:39 UTC (rev 455)
+++ pkg/R/aaa.R	2011-05-04 21:33:27 UTC (rev 456)
@@ -15,3 +15,6 @@
 setGeneric("logLik",function(object,...)standardGeneric("logLik"))
 setGeneric("window",function(x,...)standardGeneric("window"))
 setGeneric("continue",function(object,...)standardGeneric("continue"))
+setGeneric("pred.mean",function(object,...)standardGeneric("pred.mean"))
+setGeneric("pred.var",function(object,...)standardGeneric("pred.var"))
+setGeneric("filter.mean",function(object,...)standardGeneric("filter.mean"))

Modified: pkg/R/mif-methods.R
===================================================================
--- pkg/R/mif-methods.R	2011-05-04 21:32:39 UTC (rev 455)
+++ pkg/R/mif-methods.R	2011-05-04 21:33:27 UTC (rev 456)
@@ -1,17 +1,5 @@
 ## this file contains short definitions of methods for the 'mif' class
 
-pred.mean <- function (object, ...)
-  stop("function ",sQuote("pred.mean")," is undefined for objects of class ",sQuote(class(object)))
-setGeneric('pred.mean')  
-
-pred.var <- function (object, ...)
-  stop("function ",sQuote("pred.var")," is undefined for objects of class ",sQuote(class(object)))
-setGeneric('pred.var')  
-
-filter.mean <- function (object, ...)
-  stop("function ",sQuote("filter.mean")," is undefined for objects of class ",sQuote(class(object)))
-setGeneric('filter.mean')  
-
 conv.rec <- function (object, ...)
   stop("function ",sQuote("conv.rec")," is undefined for objects of class ",sQuote(class(object)))
 setGeneric('conv.rec')  
@@ -19,37 +7,6 @@
 ## extract the estimated log likelihood
 setMethod('logLik','mif',function(object,...)object at loglik)
 
-## extract the prediction means
-setMethod(
-          'pred.mean',
-          'mif',
-          function (object, pars, ...) {
-            if (missing(pars)) pars <- rownames(object at pred.mean)
-            object at pred.mean[pars,]
-          }
-          )
-
-## extract the prediction variances
-setMethod(
-          'pred.var',
-          'mif',
-          function (object, pars, ...) {
-            if (missing(pars)) pars <- rownames(object at pred.var)
-            object at pred.var[pars,]
-          }
-          )
-
-
-## extract the filtering means
-setMethod(
-          'filter.mean',
-          'mif',
-          function (object, pars, ...) {
-            if (missing(pars)) pars <- rownames(object at filter.mean)
-            object at filter.mean[pars,]
-          }
-          )
-
 ## extract the convergence record
 setMethod(
           'conv.rec',

Added: pkg/R/pfilter-methods.R
===================================================================
--- pkg/R/pfilter-methods.R	                        (rev 0)
+++ pkg/R/pfilter-methods.R	2011-05-04 21:33:27 UTC (rev 456)
@@ -0,0 +1,34 @@
+setMethod("$",signature(x="pfilterd.pomp"),function (x,name) slot(x,name))
+setMethod("logLik",signature(object="pfilterd.pomp"),function(object,...)object at loglik)
+
+## extract the prediction means
+setMethod(
+          "pred.mean",
+          "pfilterd.pomp",
+          function (object, pars, ...) {
+            if (missing(pars)) pars <- rownames(object at pred.mean)
+            object at pred.mean[pars,]
+          }
+          )
+
+## extract the prediction variances
+setMethod(
+          "pred.var",
+          "pfilterd.pomp",
+          function (object, pars, ...) {
+            if (missing(pars)) pars <- rownames(object at pred.var)
+            object at pred.var[pars,]
+          }
+          )
+
+
+## extract the filtering means
+setMethod(
+          "filter.mean",
+          "pfilterd.pomp",
+          function (object, pars, ...) {
+            if (missing(pars)) pars <- rownames(object at filter.mean)
+            object at filter.mean[pars,]
+          }
+          )
+

Modified: pkg/R/pfilter.R
===================================================================
--- pkg/R/pfilter.R	2011-05-04 21:32:39 UTC (rev 455)
+++ pkg/R/pfilter.R	2011-05-04 21:33:27 UTC (rev 456)
@@ -322,6 +322,3 @@
           }
           )
 
-setMethod("$",signature(x="pfilterd.pomp"),function (x,name) slot(x,name))
-setMethod("logLik",signature(object="pfilterd.pomp"),function(object,...)object at loglik)
-

Modified: pkg/man/mif-methods.Rd
===================================================================
--- pkg/man/mif-methods.Rd	2011-05-04 21:32:39 UTC (rev 455)
+++ pkg/man/mif-methods.Rd	2011-05-04 21:33:27 UTC (rev 456)
@@ -6,15 +6,6 @@
 \alias{conv.rec}
 \alias{conv.rec,mif-method}
 \alias{conv.rec-mif}
-\alias{pred.mean}
-\alias{pred.mean,mif-method}
-\alias{pred.mean-mif}
-\alias{pred.var}
-\alias{pred.var,mif-method}
-\alias{pred.var-mif}
-\alias{filter.mean}
-\alias{filter.mean,mif-method}
-\alias{filter.mean-mif}
 \alias{plot-mif}
 \alias{plot,mif-method}
 \alias{compare.mif}
@@ -23,9 +14,6 @@
 \usage{
 \S4method{logLik}{mif}(object, \dots)
 \S4method{conv.rec}{mif}(object, pars, \dots)
-\S4method{pred.mean}{mif}(object, pars, \dots)
-\S4method{pred.var}{mif}(object, pars, \dots)
-\S4method{filter.mean}{mif}(object, pars, \dots)
 \S4method{plot}{mif}(x, y = NULL, \dots)
 compare.mif(z)
 }
@@ -59,18 +47,6 @@
       Plots a series of diagnostic plots.
       When \code{x} is a \code{mif} object, \code{plot(x)} is equivalent to \code{compare.mif(list(x))}.
     }
-    \item{pred.mean}{
-      \code{pred.mean(object, pars = NULL)} returns the rows of the prediction-mean matrix corresponding to the names in \code{pars}.
-      By default, all rows are returned.
-    }
-    \item{pred.var}{
-      \code{pred.var(object, pars = NULL)} returns the rows of the prediction-variance matrix corresponding to the names in \code{pars}.
-      By default, all rows are returned.
-    }
-    \item{filter.mean}{
-      \code{filter.mean(object, pars = NULL)} returns the rows of the filtering-mean matrix corresponding to the names in \code{pars}.
-      By default, all rows are returned.
-    }
     \item{predvarplot}{
       \code{predvarplot(object, pars = NULL, mean = FALSE, \dots)} produces a plot of the scaled prediction variances for each parameter.
       This can be used to diagnose a good value of the \code{mif} parameters \code{var.factor} and \code{ic.lag}.

Added: pkg/man/pfilter-methods.Rd
===================================================================
--- pkg/man/pfilter-methods.Rd	                        (rev 0)
+++ pkg/man/pfilter-methods.Rd	2011-05-04 21:33:27 UTC (rev 456)
@@ -0,0 +1,35 @@
+\name{pfilter-methods}
+\alias{logLik,pfilterd.pomp-method}
+\alias{logLik-pfilterd.pomp}
+\alias{$,pfilterd.pomp-method}
+\alias{$-pfilterd.pomp}
+\alias{pred.mean}
+\alias{pred.mean,pfilterd.pomp-method}
+\alias{pred.mean-pfilterd.pomp}
+\alias{pred.var}
+\alias{pred.var,pfilterd.pomp-method}
+\alias{pred.var-pfilterd.pomp}
+\alias{filter.mean}
+\alias{filter.mean,pfilterd.pomp-method}
+\alias{filter.mean-pfilterd.pomp}
+\title{Methods of the "pfilterd.pomp" class}
+\description{Methods of the "pfilterd.pomp" class.}
+\usage{
+\S4method{logLik}{pfilterd.pomp}(object, \dots)
+\S4method{pred.mean}{pfilterd.pomp}(object, pars, \dots)
+\S4method{pred.var}{pfilterd.pomp}(object, pars, \dots)
+\S4method{filter.mean}{pfilterd.pomp}(object, pars, \dots)
+}
+\arguments{
+  \item{object}{
+    An object of class \code{pfilterd.pomp} or inheriting class \code{pfilterd.pomp}.
+  }
+  \item{pars}{Names of parameters.}
+  \item{\dots}{
+    Additional arguments unused at present.
+  }
+}
+\author{Aaron A. King \email{kingaa at umich dot edu}}
+\seealso{\code{\link{pfilter}}, \link{pomp-class}}
+\keyword{models}
+\keyword{ts}

Modified: pkg/man/pfilter.Rd
===================================================================
--- pkg/man/pfilter.Rd	2011-05-04 21:32:39 UTC (rev 455)
+++ pkg/man/pfilter.Rd	2011-05-04 21:33:27 UTC (rev 456)
@@ -4,10 +4,6 @@
 \alias{pfilter-pomp}
 \alias{pfilter,pfilterd.pomp-method}
 \alias{pfilter-pfilterd.pomp}
-\alias{logLik,pfilterd.pomp-method}
-\alias{logLik-pfilterd.pomp}
-\alias{$,pfilterd.pomp-method}
-\alias{$-pfilterd.pomp}
 \alias{pfilterd.pomp-class}
 \title{Particle filter}
 \description{



More information about the pomp-commits mailing list