% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{findmax}
\alias{findmax}
\title{Find Maximum}
\usage{
findmax(sens, design_space, grid.length, n_starts = 5L)
}
\arguments{
\item{sens}{Sensitivity function (scalar for 1D, named numeric vector for multi-factor).}

\item{design_space}{Numeric vector \code{c(min, max)} or named list.}

\item{grid.length}{Number of grid / LHS points for the initial sweep.}

\item{n_starts}{Number of local-optimisation restarts (multi-factor only).}
}
\value{
The design point (scalar or named numeric vector) at which \code{sens} is maximised.
}
\description{
Searches the location of the maximum of a sensitivity function over the design space.
For single-factor models the search uses a regular grid followed by direct selection.
For multi-factor models a Latin Hypercube Sample is evaluated and then refined with
L-BFGS-B local optimisation from the \code{n_starts} best candidate points.
}
