diff --git a/DESCRIPTION b/DESCRIPTION index 9f76751c..ed3b99e9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: pomp Type: Package Title: Statistical Inference for Partially Observed Markov Processes -Version: 6.0.2.2 -Date: 2024-12-15 +Version: 6.0.2.3 +Date: 2024-12-18 Authors@R: c(person(given=c("Aaron","A."),family="King",role=c("aut","cre"),email="kingaa@umich.edu",comment=c(ORCID="0000-0001-6159-3207")), person(given=c("Edward","L."),family="Ionides",role="aut",comment=c(ORCID="0000-0002-4190-0174")) , person(given="Carles",family="Bretó",role="aut",comment=c(ORCID="0000-0003-4695-4902")), diff --git a/R/userdata.R b/R/userdata.R index b80103c9..6d8576d7 100644 --- a/R/userdata.R +++ b/R/userdata.R @@ -1,4 +1,4 @@ -##' Facilities for making additional information to basic components +##' Facilities for making additional information available to basic model components ##' ##' When \acronym{POMP} basic components need information they can't get from parameters or covariates. ##' diff --git a/examples/kf.R b/examples/kf.R index 905f3491..6b290bb9 100644 --- a/examples/kf.R +++ b/examples/kf.R @@ -1,29 +1,26 @@ -\donttest{ # takes too long for R CMD check +if (require(dplyr)) { - if (require(dplyr)) { + gompertz() -> po - gompertz() -> po + po |> + as.data.frame() |> + mutate( + logY=log(Y) + ) |> + select(time,logY) |> + pomp(times="time",t0=0) |> + kalmanFilter( + X0=c(logX=0), + A=matrix(exp(-0.1),1,1), + Q=matrix(0.01,1,1), + C=matrix(1,1,1), + R=matrix(0.01,1,1) + ) -> kf - po |> - as.data.frame() |> - mutate( - logY=log(Y) - ) |> - select(time,logY) |> - pomp(times="time",t0=0) |> - kalmanFilter( - X0=c(logX=0), - A=matrix(exp(-0.1),1,1), - Q=matrix(0.01,1,1), - C=matrix(1,1,1), - R=matrix(0.01,1,1) - ) -> kf + po |> + pfilter(Np=1000) -> pf - po |> - pfilter(Np=1000) -> pf + kf$logLik + logLik(pf) + sum(log(obs(pf))) - kf$logLik - logLik(pf) + sum(log(obs(pf))) - - } } diff --git a/man/kf.Rd b/man/kf.Rd index 1ffd8f25..edf36e9d 100644 --- a/man/kf.Rd +++ b/man/kf.Rd @@ -53,34 +53,31 @@ Then the Kalman filter computes the exact likelihood of \eqn{Y} given \eqn{A}, \eqn{C}, \eqn{Q}, and \eqn{R}. } \examples{ -\donttest{ # takes too long for R CMD check +if (require(dplyr)) { - if (require(dplyr)) { + gompertz() -> po - gompertz() -> po + po |> + as.data.frame() |> + mutate( + logY=log(Y) + ) |> + select(time,logY) |> + pomp(times="time",t0=0) |> + kalmanFilter( + X0=c(logX=0), + A=matrix(exp(-0.1),1,1), + Q=matrix(0.01,1,1), + C=matrix(1,1,1), + R=matrix(0.01,1,1) + ) -> kf - po |> - as.data.frame() |> - mutate( - logY=log(Y) - ) |> - select(time,logY) |> - pomp(times="time",t0=0) |> - kalmanFilter( - X0=c(logX=0), - A=matrix(exp(-0.1),1,1), - Q=matrix(0.01,1,1), - C=matrix(1,1,1), - R=matrix(0.01,1,1) - ) -> kf + po |> + pfilter(Np=1000) -> pf - po |> - pfilter(Np=1000) -> pf + kf$logLik + logLik(pf) + sum(log(obs(pf))) - kf$logLik - logLik(pf) + sum(log(obs(pf))) - - } } } \seealso{ diff --git a/man/userdata.Rd b/man/userdata.Rd index bb2384c1..a831276c 100644 --- a/man/userdata.Rd +++ b/man/userdata.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/userdata.R \name{userdata} \alias{userdata} -\title{Facilities for making additional information to basic components} +\title{Facilities for making additional information available to basic model components} \description{ When \acronym{POMP} basic components need information they can't get from parameters or covariates. }