[Pomp-commits] r816 - in pkg/pomp: . R tests
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Jan 15 11:28:51 CET 2013
Author: kingaa
Date: 2013-01-15 11:28:51 +0100 (Tue, 15 Jan 2013)
New Revision: 816
Modified:
pkg/pomp/DESCRIPTION
pkg/pomp/R/mif.R
pkg/pomp/tests/ou2-mif2.R
pkg/pomp/tests/ou2-mif2.Rout.save
Log:
- fig bug in mif: non-constant Np was ignored
Modified: pkg/pomp/DESCRIPTION
===================================================================
--- pkg/pomp/DESCRIPTION 2013-01-14 16:57:25 UTC (rev 815)
+++ pkg/pomp/DESCRIPTION 2013-01-15 10:28:51 UTC (rev 816)
@@ -2,7 +2,7 @@
Type: Package
Title: Statistical inference for partially observed Markov processes
Version: 0.44-1
-Date: 2013-01-10
+Date: 2013-01-15
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/pomp/R/mif.R
===================================================================
--- pkg/pomp/R/mif.R 2013-01-14 16:57:25 UTC (rev 815)
+++ pkg/pomp/R/mif.R 2013-01-15 10:28:51 UTC (rev 816)
@@ -170,6 +170,8 @@
if (!missing(cooling.factor) && !(is.na(cooling.factor)))
warning(sQuote("cooling.factor")," ignored for method = ",sQuote("mif2"),call.=FALSE)
cooling.factor <- as.numeric(NA)
+ if (Np[1]!=Np[ntimes+1])
+ stop("the first and last values of ",sQuote("Np")," must agree when method = ",sQuote("mif2"))
} else {
if (missing(cooling.factor) || is.na(cooling.factor))
stop("mif error: ",sQuote("cooling.factor")," must be specified",call.=FALSE)
@@ -228,7 +230,7 @@
obj <- as(object,"pomp")
if (Nmif>0) {
- tmp.mif <- new("mif",object,particles=particles,Np=Np)
+ tmp.mif <- new("mif",object,particles=particles,Np=Np[1])
} else {
pfp <- obj
}
@@ -272,6 +274,7 @@
pfilter.internal(
object=obj,
params=P,
+ Np=Np,
tol=tol,
max.fail=max.fail,
pred.mean=(n==Nmif),
Modified: pkg/pomp/tests/ou2-mif2.R
===================================================================
--- pkg/pomp/tests/ou2-mif2.R 2013-01-14 16:57:25 UTC (rev 815)
+++ pkg/pomp/tests/ou2-mif2.R 2013-01-15 10:28:51 UTC (rev 816)
@@ -2,11 +2,6 @@
pompExample(ou2)
-
-set.seed(1285370209L)
-
-set.seed(409003325L)
-
pdf(file="ou2-mif2.pdf")
p.truth <- coef(ou2)
Modified: pkg/pomp/tests/ou2-mif2.Rout.save
===================================================================
--- pkg/pomp/tests/ou2-mif2.Rout.save 2013-01-14 16:57:25 UTC (rev 815)
+++ pkg/pomp/tests/ou2-mif2.Rout.save 2013-01-15 10:28:51 UTC (rev 816)
@@ -25,11 +25,6 @@
newly created pomp objects:
ou2
>
->
-> set.seed(1285370209L)
->
-> set.seed(409003325L)
->
> pdf(file="ou2-mif2.pdf")
>
> p.truth <- coef(ou2)
@@ -53,7 +48,7 @@
+ tol=1e-8
+ )
Warning message:
-'cooling.factor' ignored for method = 'mif2'
+'cooling.factor' ignored for method='mif2'
>
> mif2a <- mif(ou2,Nmif=100,start=guess1,
+ pars=c('alpha.2','alpha.3'),ivps=c('x1.0','x2.0'),
@@ -71,7 +66,7 @@
+ tol=1e-8
+ )
Warning message:
-'cooling.fraction' ignored for method != 'mif2'
+'cooling.fraction' ignored for method!='mif2'
>
> compare.mif(list(mif1a,mif2a))
>
@@ -90,7 +85,7 @@
+ method="mif2"
+ )
Warning message:
-'cooling.factor' ignored for method = 'mif2'
+'cooling.factor' ignored for method='mif2'
> mif1b <- continue(mif1b,Nmif=50)
>
> mif2b <- mif(ou2,Nmif=50,start=guess1,
@@ -120,4 +115,4 @@
>
> proc.time()
user system elapsed
- 42.378 0.072 42.737
+ 42.274 0.064 42.654
More information about the pomp-commits
mailing list