% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/est_mg.R
\name{.run_unit_loop}
\alias{.run_unit_loop}
\title{Run unit-level OLS over a list of (y, X) pairs}
\usage{
.run_unit_loop(panel_list, fast = TRUE, n_cores = 1L)
}
\arguments{
\item{panel_list}{Named list of \code{list(y, X)} pairs.}

\item{fast}{Logical: use the compiled C++ fast path when available?
Default \code{TRUE}.}

\item{n_cores}{Integer: number of cores for parallel unit estimation.
Only effective on Unix/macOS. Default \code{1L} (no parallelism).}
}
\value{
A named list of unit-level OLS results matching the structure
returned by \code{.unit_ols()}.
}
\description{
Dispatcher used by \code{dcce()}. Accepts a named list where each element
is a list with elements \code{y} and \code{X}. Returns a list of unit-level
OLS result lists with the same names. Internally dispatches to:
\itemize{
\item the C++ batch routine (\code{.batch_ols_cpp}) when
\code{fast = TRUE} and the compiled shared library is available;
\item \code{parallel::mclapply()} when \code{n_cores > 1} and the
platform is Unix/macOS;
\item the pure-R \code{.unit_ols()} in all other cases.
}
}
\keyword{internal}
