[Pomp-commits] r442 - in pkg: . R man tests
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Apr 19 14:04:32 CEST 2011
Author: kingaa
Date: 2011-04-19 14:04:31 +0200 (Tue, 19 Apr 2011)
New Revision: 442
Added:
pkg/tests/synlik.R
Modified:
pkg/DESCRIPTION
pkg/R/probe.R
pkg/man/probed-pomp-methods.Rd
Log:
- add 'logLik' method for probed.pomp objects
Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION 2011-04-15 18:32:10 UTC (rev 441)
+++ pkg/DESCRIPTION 2011-04-19 12:04:31 UTC (rev 442)
@@ -1,8 +1,8 @@
Package: pomp
Type: Package
Title: Statistical inference for partially observed Markov processes
-Version: 0.36-2
-Date: 2011-04-12
+Version: 0.36-3
+Date: 2011-04-18
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/R/probe.R
===================================================================
--- pkg/R/probe.R 2011-04-15 18:32:10 UTC (rev 441)
+++ pkg/R/probe.R 2011-04-19 12:04:31 UTC (rev 442)
@@ -191,3 +191,4 @@
}
)
+setMethod("logLik",signature(object="probed.pomp"),function(object,...)object at synth.loglik)
Modified: pkg/man/probed-pomp-methods.Rd
===================================================================
--- pkg/man/probed-pomp-methods.Rd 2011-04-15 18:32:10 UTC (rev 441)
+++ pkg/man/probed-pomp-methods.Rd 2011-04-19 12:04:31 UTC (rev 442)
@@ -21,6 +21,8 @@
\alias{plot,spect.pomp-method}
\alias{plot-spect.pomp}
\alias{as,probed.pomp-method}
+\alias{logLik,probed.pomp-method}
+\alias{logLik-probed.pomp}
\alias{coerce,probed.pomp,data.frame-method}
\title{Methods of the "probed.pomp", "probe.matched.pomp", "spect.pomp", and "spect.matched.pomp" classes}
\description{Methods of the \code{probed.pomp}, \code{probe.matched.pomp}, \code{spect.pomp}, and \code{spect.matched.pomp} classes}
@@ -30,6 +32,7 @@
\S4method{summary}{probe.matched.pomp}(object, \dots)
\S4method{plot}{probe.matched.pomp}(x, y, \dots)
\S4method{summary}{spect.pomp}(object, \dots)
+\S4method{logLik}{probed.pomp}(object, \dots)
\S4method{plot}{spect.pomp}(x, y, max.plots.per.page = 4,
plot.data = TRUE,
quantiles = c(.025, .25, .5, .75, .975),
@@ -63,6 +66,10 @@
\item{summary}{
displays summary information.
}
+ \item{logLik}{
+ returns the synthetic likelihood for the probes.
+ NB: in general, this is not the same as the likelihood.
+ }
\item{as}{
when a \sQuote{probed.pomp} is coerced to a \sQuote{data.frame}, the first row gives the probes applied to the data; the rest of the rows give the probes evaluated on simulated data.
The rownames of the result can be used to distinguish these.
Added: pkg/tests/synlik.R
===================================================================
--- pkg/tests/synlik.R (rev 0)
+++ pkg/tests/synlik.R 2011-04-19 12:04:31 UTC (rev 442)
@@ -0,0 +1,15 @@
+library(pomp)
+
+data(ou2)
+
+set.seed(6457673L)
+
+po <- window(ou2,end=5)
+
+pb <- replicate(n=100,logLik(probe(po,nsim=1000,probes=function(x)x)))
+pf <- replicate(n=100,logLik(pfilter(po,Np=1000)))
+
+kruskal.test(list(pb,pf))
+ks.test(pf,pb)
+qqplot(pf,pb)
+abline(a=0,b=1)
More information about the pomp-commits
mailing list