res: Compare data and model prediction by computing residuals
Description
Compare data and model prediction by computing residuals
Usage
res(data, out, err = NULL)
Arguments
data
data.frame with name (factor), time (numeric), value (numeric) and sigma (numeric)
out
output of ode(), optionally augmented with attributes
"deriv" (output of ode() for the sensitivity equations) and
"parameters" (character vector of parameter names, a subsest of those
contained in the sensitivity equations). If "deriv" is given, also "parameters"
needs to be given.
err
output of the error model function
Value
data.frame with the original data augmented by columns "prediction" (
numeric, the model prediction), "residual" (numeric, difference between
prediction and data value), "weighted.residual" (numeric, residual devided
by sigma). If "deriv" was given, the returned data.frame has an
attribute "deriv" (data.frame with the derivatives of the residuals with
respect to the parameters).