You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: R/saved_states.R
+37-4
Original file line number
Diff line number
Diff line change
@@ -13,10 +13,20 @@
13
13
##' @family particle filter methods
14
14
##' @family extraction methods
15
15
##' @inheritParams filter.mean
16
+
##' @param format character;
17
+
##' format of the returned object (see below).
16
18
##'
17
-
##' @return The saved states are returned in the form of a list, with one element per time-point.
18
-
##' Each element consists of a matrix, with one row for each state variable and one column for each particle.
19
+
##' @return According to the \code{format} argument, the saved states are returned either as a list or a data frame.
19
20
##'
21
+
##' If \code{format="data.frame"}, then the returned data frame holds the state variables and (optionally) the log weight of each particle at each observation time.
22
+
##' The \code{.id} variable distinguishes particles.
23
+
##'
24
+
##' If \code{format="list"} and \code{\link{pfilter}} was called with \code{save.states="unweighted"} or \code{save.states="TRUE"}, the returned list contains one element per observation time.
25
+
##' Each element consists of a matrix, with one row for each state variable and one column for each particle.
26
+
##' If \code{\link{pfilter}} was called with \code{save.states="weighted"}, the list itself contains two lists:
27
+
##' the first holds the particles as above, the second holds the corresponding log weights.
28
+
##' In particular, it has one element per observation time; each element is the vector of per-particle log weights.
Copy file name to clipboardexpand all lines: inst/NEWS.Rd
+7
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,12 @@
1
1
\name{NEWS}
2
2
\title{Newsforpackage `pomp'}
3
+
\section{Changes in \pkg{pomp} version 4.4.1}{
4
+
\itemize{
5
+
\item It is now possible to retrieve the weighted particles computed in the course of a \code{pfilter} computation.
6
+
To accomplish this, set \code{save.states="weighted"} in the call to \code{pfilter} and retrieve the particles and their weights using \code{saved.states}.
7
+
Previously, one could obtain only the unweighted particles.
0 commit comments