Skip to contents

Control numerical fitting in `gwrs`

Usage

gwrs_control(
  tolerance = 1e-07,
  max_iterations = 1000L,
  n_threads = -1L,
  grain_size = 16L,
  keep_data = TRUE,
  diagnostics = TRUE,
  nonconvex_solver = c("coordinate", "guarded_block")
)

Arguments

tolerance

Relative coefficient convergence tolerance.

max_iterations

Maximum number of solver iterations per location.

n_threads

Number of parallel worker threads. Use `1` for serial execution or `-1` to let `RcppParallel` choose.

grain_size

Minimum number of target locations assigned per parallel task.

keep_data

Whether fitted objects retain the training matrices.

diagnostics

Statistical diagnostic level. `"standard"` computes compact fit and effective-degrees-of-freedom diagnostics, `"full"` also retains quantities needed for local coefficient inference, and `"none"` skips statistical diagnostics. Logical values remain supported for backward compatibility (`TRUE` maps to `"standard"`). Numerical solver diagnostics are always retained because they are small and are required to audit convergence.

nonconvex_solver

Gaussian SCAD/MCP solver: `"coordinate"` retains the legacy updates and failure behavior (default); `"guarded_block"` adds objective-decreasing pair and flat-tail QR proposals. In guarded mode a failed target stops its remaining lambda path. CV scores require convergence for every held-out observation. Other estimators ignore this option. No environment variable is needed.

Value

A list of class `gwrs_control`.

Examples

control <- gwrs_control(
  tolerance = 1e-6,
  max_iterations = 500,
  n_threads = 1,
  diagnostics = "full"
)
control