fitByDE {hydromad}R Documentation

Fit a hydromad model using the DE (Differential Evolution) algorithm.

Description

Fit a hydromad model using the DE (Differential Evolution) algorithm.

Usage

fitByDE(MODEL, 
        objective = hydromad.getOption("objective"),
        control = hydromad.getOption("de.control"))

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 DE algorithm. See DEoptim.control.

Value

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

fit.result

the result from DEoptim.

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)

Felix Andrews felix@nfrac.org

See Also

DEoptim, objFunVal

Examples

library("DEoptim")

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

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

foo <- fitByDE(modx, control = DEoptim.control(itermax = 5))

summary(foo)

## return value from DE:
str(foo$fit.result)

## plot objective function value convergence over time
xyplot(optimtrace(foo), type = "b",
  xlab = "function evaluations", ylab = "objective fn. value")
[Package hydromad version 0.9-18 Index]