% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tune_Lambda.R
\name{.damped_bfgs}
\alias{.damped_bfgs}
\title{Damped BFGS Optimizer for Penalty Tuning}
\usage{
.damped_bfgs(
  par,
  log_penalty_vec,
  criterion_fxn,
  gr_fxn,
  env,
  tol,
  max_iter = 100,
  ...
)
}
\arguments{
\item{par}{Numeric vector; initial log-scale penalty parameters (first two
elements are log(wiggle) and log(flat_ridge)).}

\item{log_penalty_vec}{Numeric vector; log-scale predictor/partition
penalties appended to the optimization vector.}

\item{criterion_fxn}{Function; tuning-objective evaluation function with signature
\code{function(par, log_penalty_vec, env, ...)}.}

\item{gr_fxn}{Function; gradient function with signature
\code{function(par, log_penalty_vec, outlist, env, ...)}.}

\item{env}{List; tuning environment (passed through to
\code{criterion_fxn} and \code{gr_fxn}).}

\item{tol}{Numeric; convergence tolerance for both criterion change and
parameter change.}

\item{max_iter}{Integer; maximum number of BFGS iterations (default 100).}

\item{...}{Additional arguments passed to fitting functions.}
}
\value{
List containing the best parameter vector found, the corresponding
  criterion value, and the number of iterations performed.
}
\description{
Custom implementation of damped BFGS quasi-Newton optimization for
minimizing the selected tuning criterion. Uses step-size damping with
backtracking and Sherman-Morrison-Woodbury inverse Hessian updates.
}
\details{
The optimizer uses the following strategy:
\enumerate{
  \item Iterations 1-2: steepest descent with damping.
  \item Iteration 3+: BFGS quasi-Newton with inverse Hessian approximation
    updated via the standard secant condition. Falls back to identity
    matrix when the update is numerically unstable.
  \item Step acceptance: Armijo-like criterion (accept if
    \eqn{\mathrm{GCV}_{u}^{(\mathrm{new})} \leq
    \mathrm{GCV}_{u}^{(\mathrm{old})}}).
  \item Backtracking: damping factor halved on rejection; terminates
    when damp < \eqn{2^{-10}} (early iterations) or \eqn{2^{-12}}
    (later iterations).
}
}
\keyword{internal}
