cost: Cost Function for Nonlinear Fits

View source: R/cost.R

costR Documentation

Cost Function for Nonlinear Fits

Description

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

Usage

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:

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 Oct. 4, 2022, 1:06 a.m.