% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/batch-means.R
\name{batch_means_estimator}
\alias{batch_means_estimator}
\title{Batch-Means Covariance Estimator for SGD Trajectories}
\usage{
batch_means_estimator(
  trajectory,
  alpha = 0.501,
  M = NULL,
  N = NULL,
  drop_burnin = TRUE,
  burnin_iter = 0
)
}
\arguments{
\item{trajectory}{numeric matrix with rows = iterations and columns = parameters.}

\item{alpha}{stepsize decay exponent in
\eqn{\eta_i = \eta i^{-\alpha}}. Must satisfy \eqn{1/2 < \alpha < 1}.}

\item{M}{number of retained batches (excluding burn-in batch 0). If `NULL`,
use \eqn{\lfloor n^{(1-\alpha)/2} \rfloor}.}

\item{N}{decorrelation constant in
\eqn{e_k = \lfloor ((k+1)N)^{1/(1-\alpha)} \rfloor}. If `NULL`, use
\eqn{N = n^{1-\alpha}/(M+1)}.}

\item{drop_burnin}{logical; if `TRUE`, discard batch 0.}

\item{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.}
}
\value{
A list containing the covariance estimate, pooled mean, batch sizes,
batch boundaries, and chain-level metadata.
}
\description{
Estimate the asymptotic covariance from a single SGD trajectory using the
increasing-batch construction from Xi et al. (2020).
}
