\Header{optimize}{One Dimensional Optimization}
\alias{optimise}{optimize}
\keyword{optimize}{optimize}
\begin{Usage}
\begin{verbatim}
optimise(.........)
optimize(f=, interval=, lower=min(interval),
        upper=max(interval), maximum=FALSE,
        tol=.Machine$double.eps^0.25, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\texttt{f}] the function to be optimized. The function is
either minimized or maximized over its first argument
depending on the value of \texttt{maximum}.
\item[\texttt{interval}] a vector containing the end-points of the interval
to be searched for the minimum.
\item[\texttt{lower}] the lower end point of the interval
to be searched.
\item[\texttt{upper}] the upper end point of the interval
to be searched.
\item[\texttt{tol}] the desired accuracy.
\item[\texttt{...}] additional arguments to \texttt{f}.
\end{ldescription}
\end{Arguments}
\begin{Description}
The function \texttt{optimize} searches the interval from
\texttt{lower} to \texttt{upper} for a minimum or maximum of
the function \texttt{f} with respect to its first argument.

It uses Fortran code (from Netlib) based on algorithms given in the
reference.

\texttt{optimise} is an alias for \texttt{optimize}.\end{Description}
\begin{Value}
A list with components \texttt{minimum} (or \texttt{maximum})
and \texttt{objective} which give the location of the minimum (or maximum)
and the value of the function at that point.\end{Value}
\begin{References}
Brent, R. (1973).
\emph{Algorithms for Minimization without Derivatives}.
Englewood Cliffs N.J.: Prentice-Hall.\end{References}
\begin{SeeAlso}
\texttt{\Link{nlm}}, \texttt{\Link{uniroot}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
f <- function (x,a) (x-a)^2
xmin <- optimize(f, c(0, 1), tol=0.0001, a=1/3)
xmin
\end{ExampleCode}
\end{Examples}

