foxleg {RGeostats} | R Documentation |
Optimize a set of parameters
foxleg(formula, start = NA, lower = NA, upper = NA, equal = NA, weights = NA, maxiter = 1000, tolstop = 1.e-3, epsdelta = 1.e-5, delta=1, 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. |
equal |
a named list or named numeric vector of equalities for the set of parameters. |
weights |
Set of weights attached to each datum. If not provided, the weights are defaulted to 1 |
maxiter |
Maximum number of iterations |
tolstop |
Tolerance for the distance between the experiment and the model. This quantity is transformed internally proportionally to the variance of the data. |
epsdelta |
Tolerance for the direction increment used in the gradient search |
delta |
Delta value |
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)