% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/absorb.R
\name{.absorb_demean_multi}
\alias{.absorb_demean_multi}
\title{Alternating projections for multi-factor demeaning}
\usage{
.absorb_demean_multi(X, groups, tol = 1e-10, max_iter = 200L)
}
\arguments{
\item{X}{Numeric vector or matrix.}

\item{groups}{A list of factors (from \code{.absorb_resolve()}).}

\item{tol}{Numeric: convergence tolerance on max absolute change.}

\item{max_iter}{Integer: hard iteration cap.}
}
\value{
Within-transformed X.
}
\description{
Iteratively projects X off each grouping factor until convergence.
Correia (2016) shows this converges geometrically for any finite
number of factors; in practice 10-30 iterations suffice for the
tolerances used below.
}
\keyword{internal}
