propagation {gmgm} | R Documentation |
Propagate particles forward in time
Description
This function propagates particles forward in time. Assuming that the
particles have been propagated to a given time slice t
, the aim is to
propagate them to a later time slice t + k
according to the Gaussian
mixture graphical model and to the evidence collected over time. At first, a
renewal step is performed if the effective sample size (ESS) is below a given
threshold (Doucet and Johansen, 2009). This step consists in randomly
selecting new particles among the old ones proportionately to their current
weights. Upon receiving the data (the evidence) of t + 1
, each particle
is used to generate samples for the unknown values. Its weight is then
updated to the likelihood for the observed values. The higher this
likelihood, the more likely the particle is selected at the next renewal step
for propagation to t + 2
, and so on (Koller and Friedman, 2009).
Usage
propagation(
part,
gmgm,
evid = NULL,
col_seq = NULL,
col_weight = "weight",
n_times = 1,
min_ess = 1
)
Arguments
part |
A data frame containing the particles propagated to time slice
|
gmgm |
An object of class |
evid |
A data frame containing the evidence of time slices
|
col_seq |
A character vector containing the column names of |
col_weight |
A character string corresponding to the column name of
|
n_times |
A non-negative integer corresponding to the number of time
slices |
min_ess |
A numeric value in [0, 1] corresponding to the minimum ESS
(expressed as a proportion of the number of particles) under which the
renewal step is performed. If |
Value
A data frame (tibble) containing the particles supplemented with the
samples of time slices t + 1, \dots , t + k
.
References
Doucet, A. and Johansen, A. M. (2009). A Tutorial on Particle Filtering and Smoothing: Fifteen years later. Handbook of nonlinear filtering, 12:656–704.
Koller, D. and Friedman, N. (2009). Probabilistic Graphical Models: Principles and Techniques. The MIT Press.
See Also
Examples
library(dplyr)
set.seed(0)
data(gmdbn_air, data_air)
evid <- data_air %>%
group_by(DATE) %>%
slice(1:3) %>%
ungroup()
evid$NO2[sample.int(150, 30)] <- NA
evid$O3[sample.int(150, 30)] <- NA
evid$TEMP[sample.int(150, 30)] <- NA
evid$WIND[sample.int(150, 30)] <- NA
part <- particles(data.frame(DATE = unique(evid$DATE))) %>%
propagation(gmdbn_air, evid, col_seq = "DATE", n_times = 3)