\inputencoding{utf8}
\HeaderA{fminsearch.function}{fminsearch Cost Function Call}{fminsearch.function}
\keyword{method}{fminsearch.function}
%
\begin{Description}\relax
This function calls the cost function and makes it match neldermead
requirements. It is used in the \code{fminsearch} function as the
\code{function} element of the neldermead object (see \code{?neldermead.new}
and \code{?neldermead.configure}). 
\end{Description}
%
\begin{Usage}
\begin{verbatim}
  fminsearch.function(x = NULL, index = NULL, fmsfundata = NULL)
\end{verbatim}
\end{Usage}
%
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] A single column vector of parameter estimates.
\item[\code{index}] An integer variable set to 2, indicating that only the cost
function is to be computed by the algorithm.
\item[\code{fmsfundata}] A list with a type attribute set to 'T\_FARGS' and
with (at least) a \code{fun} element, which contain the user-defined cost
function.
\end{ldescription}
\end{Arguments}
%
\begin{Value}
Returns a list with the following elements: \begin{description}

\item[f] The value of the cost function at the current point estimate.
\item[index] The same \code{index} variable.
\item[this] A list with a single element \code{costargument} which
contains \code{fmsfundata}.

\end{description}

\end{Value}
%
\begin{Author}\relax
Author of Scilab neldermead module: Michael Baudin (INRIA - Digiteo)

Author of R adaptation: Sebastien Bihorel (\email{sb.pmlab@gmail.com})
\end{Author}
%
\begin{SeeAlso}\relax
\code{\LinkA{fminsearch}{fminsearch}},
\code{\LinkA{neldermead.new}{neldermead.new}},
\code{\LinkA{neldermead.configure}{neldermead.configure}},
\end{SeeAlso}
