fitByDDS {hydromad}R Documentation

Fit a hydromad model using DDS (Dynamically Dimensioned Search) algorithm.

Description

Fit a hydromad model using DDS (Dynamically Dimensioned Search) algorithm.

Usage

fitByDDS(MODEL, objective = hydromad.getOption("objective"),
  control = hydromad.getOption("dds.control"), save = NULL)

Arguments

MODEL

a model specification created by hydromad. It should not be fully specified, i.e one or more parameters should be defined by ranges of values rather than exact values.

objective

objective function to maximise, given as a function(Q, X, ...). See objFunVal.

control

settings for the DDS algorithm. These are the arguments to optim_dds.

save

Optional function(pars,objective value,model) that will be called for every model evaluation, for example to save every model run.

Details

This function depends on the ppso package, available from http://www.rforge.net/ppso/. For alternative optimisation algorithms, consider fitBySCE.

Value

the best model from those sampled, according to the given objective function. Also, these extra elements are inserted:

fit.result

the result from SCEoptim.

objective

the objective function used.

funevals

total number of evaluations of the model simulation function.

timing

timing vector as returned by system.time.

Author(s)

Joseph Guillaume josephguillaume@gmail.com

References

Tolson, B. A., and C. A. Shoemaker (2007) Dynamically dimensioned search algorithm for computationally efficient watershed model calibration, Water Resour. Res., 43, W01413, doi:10.1029/2005WR004723. http://www.agu.org/journals/wr/wr0701/2005WR004723/

See Also

optim_dds,fitBySCE

Examples

data(Cotter)
x <- Cotter[1:1000]

## IHACRES CWI model with power law unit hydrograph
modx <- hydromad(x, sma = "cwi", routing = "powuh")
modx

## run with cut-down settings (for a speedy example only!)
foo <- fitByDDS(modx, control = list(
   max_number_function_calls=100,
   logfile=NULL,
           projectfile=NULL,
           load_projectfile="no"
))

summary(foo)

## return value from DDS:
str(foo$fit.result)
[Package hydromad version 0.9-18 Index]