\inputencoding{utf8}
\HeaderA{compute.secondary}{Computes secondary parameter values}{compute.secondary}
\keyword{method}{compute.secondary}
%
\begin{Description}\relax
\code{compute.secondary} is a secondary function called during estimations
runs. It evaluates the code provided in the \$SECONDARY block of the model 
file; all parameters defined in this block are considered as secondary
parameters at the initial and the final estimates of the model parameters. 
\code{compute.secondary} is typically not called directly by users.
\end{Description}
%
\begin{Usage}
\begin{verbatim}
  compute.secondary(subproblem = NULL,
                    x = NULL)
\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 as many levels as there are treatment levels 
for the subject (or population) being evaluated, plus the \code{trts} 
level listing all treatments for this subject (or population), and the 
\code{id} level giving the identification number of the subject (or set to
1 if the analysis was run at the level of the population.

Each treatment-specific level is a list containing the following levels: 
\begin{description}

\item[ana] mij 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) for this particular treatment.
\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.
\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[trt] the particular treatment identifier.

\end{description}


\end{description}


\item[\code{x}] The vector of \emph{p} final parameter estimates.
\end{ldescription}
\end{Arguments}
%
\begin{Value}
Return a list of with the following elements:\begin{description}

\item[init] The vector of \emph{s} secondary parameter estimates derived
from initial structural model parameter estimates.
\item[estimates] The vector of \emph{s} secondary parameter estimates
derived from final structural model parameter estimates.
\item[names] The vector of \emph{s} secondary parameter names.

\end{description}

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