foxleg {RGeoS} | R Documentation |
Optimize a set of parameters
foxleg(formula, start = NA, lower = NA, upper = NA, weights = NA, verbose = FALSE)
formula |
a nonlinear model formula (including variables and parameters) which describes the link between a response variable, some explanatory variables and the parameters to optimize. |
start |
a named list or named numeric vector of starting estimates. When the initial value is missing for some parameters, they are initialized with a very cheap guess. |
lower |
a named list or named numeric vector of lower bounds for the set of parameters. If they are not defined for some parameters, the corresponding lower bounds are set to -infinity. |
upper |
a named list or named numeric vector of upper bounds for the set of parameters. If they are not defined for some parameters, the corresponding lower bounds are set to +infinity. |
weights |
Set of weights attached to each datum. If not provided, the weights are defaulted to 1 |
verbose |
Verbose flag. |
The list containing the optimal values for each parameter.
# Generate two initial vectors of 100 values (with some randomization) x <- 2 + rnorm(100) y <- exp(-0.5 * x) + 0.1 * rnorm(100) res<- foxleg(y~exp(-a*x)+b) xp <- seq(-1,6.,0.01) yp <- exp(-res$a * xp) + res$b plot(x,y) lines(xp,yp)