% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tune_Lambda.R
\name{.compute_meta_penalty_gradient}
\alias{.compute_meta_penalty_gradient}
\title{Compute Gradient of Regularization (Meta) Penalty}
\usage{
.compute_meta_penalty_gradient(
  wiggle_penalty,
  penalty_vec,
  meta_penalty_coef,
  unique_penalty_per_predictor,
  unique_penalty_per_partition
)
}
\arguments{
\item{wiggle_penalty}{Numeric; current wiggle penalty on raw scale.}

\item{penalty_vec}{Numeric vector; current predictor/partition penalties
on raw scale. May be empty (\code{c()}).}

\item{meta_penalty_coef}{Numeric; coefficient for the meta-penalty.}

\item{unique_penalty_per_predictor}{Logical; whether predictor-specific
penalties are active.}

\item{unique_penalty_per_partition}{Logical; whether partition-specific
penalties are active.}
}
\value{
Numeric vector; gradient of the meta-penalty on the log scale.
  Length equals 2 + length(penalty_vec).
}
\description{
Computes the gradient of the meta-penalty with respect to the log-scale
penalty parameters, incorporating the exp parameterization chain rule.
}
\details{
Under exp parameterization \eqn{\lambda = \exp(\theta)}:
\deqn{\frac{\partial}{\partial \theta}
  \left[ 0.5 c (\exp(\theta) - 1)^{2} \right]
  = c (\lambda - 1) \lambda}
}
\keyword{internal}
