View source: R/sufficient_stats.R
| accumulate_stats | R Documentation |
Performs the additive aggregation
acc <- acc + stats component by component. After processing all
batches, the accumulator holds the full-data sufficient summary.
accumulate_stats(acc, stats)
acc |
A |
stats |
A |
The updated accumulator (class "vcmm_accumulator").
Other sufficient statistics:
compute_sufficient_stats(),
init_accumulator()
set.seed(1)
n_batch <- 50; p <- 3; q <- 2
acc <- init_accumulator(p, q)
for (b in 1:3) {
X <- cbind(1, matrix(rnorm(n_batch * (p - 1)), n_batch, p - 1))
Z <- matrix(rnorm(n_batch * q), n_batch, q)
y <- rnorm(n_batch)
ss <- compute_sufficient_stats(y, X, Z)
acc <- accumulate_stats(acc, ss)
}
acc$n_obs # 150
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.