Sequential parameter estimation for the calibration of complex models
Sequential parameter estimation for the calibration of complex models
This function performs the optimization of a function, possibly in sequential phases of increasing complexity, and it is designed for the calibration of a model, by minimizing the error function fn associated to it.
par: A numeric vector or list. The length of the par argument defines the number of parameters to be estimated (i.e. the dimension of the problem).
fn: The function to be minimized.
gr: A function computing the gradient of fn. If NULL, a numerical approximation of the gradient is used. It can be also a character specifying the method for the computation of the numerical gradient: 'central', 'forward' (the default), 'backward' or 'richardson'.
...: Additional parameters to be passed to fn.
method: The optimization method to be used. The default method is the AHR-ES (Adaptative Hierarchical Recombination Evolutionary Strategy, Oliveros-Ramos & Shin, 2016). See details for the methods available.
lower: Lower threshold value(s) for parameters. One value or a vector of the same length as par. If one value is provided, it is used for all parameters. NA means -Inf. By default -Inf is used (unconstrained).
upper: Upper threshold value(s) for parameters. One value or a vector of the same length as par. If one value is provided, it is used for all parameters. NA means Inf. By default Inf is used (unconstrained).
phases: An optional vector of the same length as par, indicating the phase at which each parameter becomes active. If omitted, default value is 1 for all parameters, performing a single optimization.
control: Parameter for the control of the algorithm itself, see details.
hessian: Logical. Should a numerically differentiated Hessian matrix be returned? Currently not implemented.
replicates: The number of replicates for the evaluation of fn. The default value is 1. A value greater than 1 is only useful for stochastic functions.
parallel: Logical. Use parallel computation numerical of gradient?
Details
In the control list, aggFn is a function to aggregate fn to a scalar value if the returned value is a vector. Some optimization algorithm can exploite the additional information provided by a vectorial output from fn.