Learn R Programming

dcce (version 0.4.2)

.run_unit_loop: Run unit-level OLS over a list of (y, X) pairs

Description

Dispatcher used by dcce(). Accepts a named list where each element is a list with elements y and X. Returns a list of unit-level OLS result lists with the same names. Internally dispatches to:

  • the C++ batch routine (.batch_ols_cpp) when fast = TRUE and the compiled shared library is available;

  • parallel::mclapply() when n_cores > 1 and the platform is Unix/macOS;

  • the pure-R .unit_ols() in all other cases.

Usage

.run_unit_loop(panel_list, fast = TRUE, n_cores = 1L)

Value

A named list of unit-level OLS results matching the structure returned by .unit_ols().

Arguments

panel_list

Named list of list(y, X) pairs.

fast

Logical: use the compiled C++ fast path when available? Default TRUE.

n_cores

Integer: number of cores for parallel unit estimation. Only effective on Unix/macOS. Default 1L (no parallelism).