
Batch-Means Covariance Estimator for SGD Trajectories
Source:R/batch-means.R
batch_means_estimator.RdEstimate the asymptotic covariance from a single SGD trajectory using the increasing-batch construction from Xi et al. (2020).
Usage
batch_means_estimator(
trajectory,
alpha = 0.501,
M = NULL,
N = NULL,
drop_burnin = TRUE,
burnin_iter = 0
)Arguments
- trajectory
numeric matrix with rows = iterations and columns = parameters.
- alpha
stepsize decay exponent in \(\eta_i = \eta i^{-\alpha}\). Must satisfy \(1/2 < \alpha < 1\).
- M
number of retained batches (excluding burn-in batch 0). If `NULL`, use \(\lfloor n^{(1-\alpha)/2} \rfloor\).
- N
decorrelation constant in \(e_k = \lfloor ((k+1)N)^{1/(1-\alpha)} \rfloor\). If `NULL`, use \(N = n^{1-\alpha}/(M+1)\).
- drop_burnin
logical; if `TRUE`, discard batch 0.
- burnin_iter
non-negative integer. Explicitly discard the first `burnin_iter` iterations before building Xi-style batches. After trimming, batch boundaries are rebuilt from iteration 1 of the retained trajectory.