calibrate: Sequential parameter estimation for the calibration of models

Description Usage Arguments Details Author(s) Examples

View source: R/calibraR-main.R

Description

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.

Usage

1
2
3
calibrate(par, fn, gr = NULL, ..., method = "default", lower = NULL,
  upper = NULL, control = list(), hessian = FALSE, phases = NULL,
  replicates = 1)

Arguments

par

A numeric vector. 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

the gradient of fn. Ignored, added for portability with other optimization functions.

method

The optimization method to be used. The 'default' method is the AHR-ES (Oliveros & Shin, 2016). All the methods from stats::optim, optimx::optimx and cmaes::cma_es are 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).

control

Parameter for the control of the algorithm itself, see details.

hessian

Logical. Should a numerically differentiated Hessian matrix be returned? Currently not implemented.

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.

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.

...

Additional parameters to be passed to fn.

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.

Author(s)

Ricardo Oliveros-Ramos

Examples

1
2
3
4
5
6
7
8
calibrate(par=rep(NA, 5), fn=SphereN)
## Not run: 
calibrate(par=rep(NA, 5), fn=SphereN, replicates=3)
calibrate(par=rep(0.5, 5), fn=SphereN, replicates=3, lower=-5, upper=5)
calibrate(par=rep(0.5, 5), fn=SphereN, replicates=3, lower=-5, upper=5, phases=c(1,1,1,2,3))
calibrate(par=rep(0.5, 5), fn=SphereN, replicates=c(1,1,4), lower=-5, upper=5, phases=c(1,1,1,2,3))

## End(Not run)

calibrar documentation built on May 2, 2019, 10:58 a.m.