Defines a cost function from the residual sum of squares between model and observational data.
cost(p, obs, FUN, fixed.p = NULL, transform, ...)
an object of class modCost
, see modCost
in
package FME
vector of fitted parameters of the growth model.
function of growth model to be fitted.
vector of fixed parameters of the growth model.
additional parameters passed to the optimizer.
Function 'cost' is implemented along the lines of the following template, see package FME for details:
cost <- function(p, obs, FUN, fixed.p = NULL, ...) {
out <- FUN(obs$time, c(p, fixed.p))
modCost(out, obs, weight = "none", ...)
}