cost: Cost Function for Nonlinear Fits

Description Usage Arguments Details Value

View source: R/cost.R

Description

Defines a cost function from the residual sum of squares between model and observational data.

Usage

1
cost(p, obs, FUN, fixed.p = NULL, transform, ...)

Arguments

p

vector of fitted parameters of the growth model.

FUN

function of growth model to be fitted.

fixed.p

vector of fixed parameters of the growth model.

...

additional parameters passed to the optimizer.

Details

Function 'cost' is implemented along the lines of the following template, see package FME for details:

1
2
3
4
cost <- function(p, obs, FUN, fixed.p = NULL, ...) {
  out <- FUN(obs$time, c(p, fixed.p))
  modCost(out, obs, weight = "none", ...)
}

Value

an object of class modCost, see modCost in package FME


growthrates documentation built on Nov. 3, 2020, 1:07 a.m.