\inputencoding{utf8}
\HeaderA{problem.eval}{Evaluation of structural and residual variability models}{problem.eval}
\keyword{method}{problem.eval}
%
\begin{Description}\relax
\code{problem.eval} is a secondary function called during estimation runs. It 
evaluates the structural model and the residual variability model at given
point estimates and at given values of the time variable. \code{problem.eval} 
is typically not called directly by users.
\end{Description}
%
\begin{Usage}
\begin{verbatim}
  problem.eval(subproblem = NULL,
               x = NULL,
               grid = FALSE,
               check = FALSE)
\end{verbatim}
\end{Usage}
%
\begin{Arguments}
\begin{ldescription}
\item[\code{subproblem}] A list containing the following levels:\begin{description}

\item[code] A list of R code extracted from the model file. Depending on 
content of the model file, the levels of this list could be: template,
derived, lags, ode, dde, output, variance, and/or secondary.
\item[method] A character string, indicating the scale of the analysis. Should
be 'population' or 'subject'.
\item[init] A data.frame of parameter data with the following columns:
'names', 'type', 'value', 'isfix', 'lb', and 'ub'.
\item[debugmode] Logical indicator of debugging mode.
\item[modfun] Model function.
\item[data] A list containing the following levels:\begin{description}

\item[xdata] 1 x m matrix of time of observations of the dependent
variables.
\item[data] m x 3 data.frame containing the times of observations of the
dependent variables (extracted from the TIME variable), the indicators 
of the type of dependent variables (extracted from the CMT variable), 
and the actual dependent variable observations (extracted from the DV 
variable).

\end{description}


\item[bolus] bij x 4 data.frame providing the instantaneous inputs for a
treatment and individual.
\item[infusion] fij x (4+c) data.frame providing the zero-order inputs for a
treatment and individual.
\item[cov] mij x c data.frame containing the times of observations of the 
dependent variables (extracted from the TIME variable) and all the
covariates identified for this particular treatment.

\end{description}


\item[\code{x}] A vector of numerical estimates of numerical parameters.
\item[\code{grid}] A logical variable, indicating whether the analysis is a direct
grid search or not.
\item[\code{check}] An indicator whether checks should be performed to validate 
function inputs.
\end{ldescription}
\end{Arguments}
%
\begin{Value}
Return a list of two elements: \begin{description}

\item[f] A vector of model evaluations at all requested time points (all
states values are concatenated into a single vector).
\item[weight] A vector of residual variability related to the model
evaluations.

\end{description}

\end{Value}
%
\begin{Author}\relax
Sebastien Bihorel (\email{sb.pmlab@gmail.com})
\end{Author}
%
\begin{SeeAlso}\relax
\code{\LinkA{fitmle}{fitmle}}
\end{SeeAlso}
