% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/features.R
\name{maxent_hinge_feature}
\alias{maxent_hinge_feature}
\title{Create a Hinge Feature}
\usage{
maxent_hinge_feature(values, name, min_knot, max_knot, reverse = FALSE)
}
\arguments{
\item{values}{Numeric vector of environmental variable values.}

\item{name}{Character string: feature name/identifier.}

\item{min_knot}{Lower knot of the hinge.}

\item{max_knot}{Upper knot of the hinge (must be strictly greater than
\code{min_knot}).}

\item{reverse}{Logical; if \code{TRUE}, use reverse hinge. Default is
\code{FALSE} (forward hinge).}
}
\value{
External pointer to a HingeFeature C++ object.
}
\description{
Creates a piecewise-linear hinge feature.
}
\details{
\strong{Forward hinge} (\code{reverse = FALSE}):
\code{eval(i) = max(0, (values[i] - min_knot) / (max_knot - min_knot))}

\strong{Reverse hinge} (\code{reverse = TRUE}):
\code{eval(i) = max(0, (max_knot - values[i]) / (max_knot - min_knot))}
}
\examples{
vals <- c(0, 5, 10, 3)
f <- maxent_hinge_feature(vals, "temperature_hinge", min_knot = 2, max_knot = 8)
maxent_feature_eval(f, 2)  # values[2] = 5 -> (5-2)/(8-2) = 0.5
}
