% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tune_Lambda.R
\name{.compute_meta_penalty}
\alias{.compute_meta_penalty}
\title{Compute Regularization (Meta) Penalty on Penalty Parameters}
\usage{
.compute_meta_penalty(
  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 scalar; the regularization penalty value.
}
\description{
Computes the regularization term that pulls predictor- and partition-specific
penalty parameters toward 1 on the raw (positive) scale. This acts as a
"meta-penalty" on the penalty magnitudes themselves.
}
\details{
The penalty takes the form:
\deqn{0.5 \times c_{\mathrm{meta}} \times \sum_{j} (\lambda_{j} - 1)^{2}
      + 0.5 \times 10^{-32} \times (\lambda_{w} - 1)^{2}}
where \eqn{\lambda_{j}} are predictor/partition penalties and
\eqn{\lambda_{w}} is the wiggle penalty.
}
\keyword{internal}
