init_accumulator: Initialize an empty sufficient-statistics accumulator

View source: R/sufficient_stats.R

init_accumulatorR Documentation

Initialize an empty sufficient-statistics accumulator

Description

Allocates a zero-filled accumulator with the correct dimensions to receive batched calls to accumulate_stats(). Use this once before a streaming loop over data batches or nodes.

Usage

init_accumulator(p, q)

Arguments

p

Integer. Number of fixed-effects columns (intercept plus spline basis).

q

Integer. Number of random-effects columns (length of alpha).

Value

A list of class "vcmm_accumulator" with the same six matrix slots as compute_sufficient_stats(), all initialised to zero, plus n_obs = 0L.

See Also

Other sufficient statistics: accumulate_stats(), compute_sufficient_stats()

Examples

acc <- init_accumulator(p = 5, q = 3)
dim(acc$C)   # 5 x 5
dim(acc$ZtZ) # 3 x 3
acc$n_obs    # 0

cevcmm documentation built on July 24, 2026, 5:07 p.m.