fitBySCE {hydromad} | R Documentation |
Fit a hydromad model using the SCE (Shuffled Complex Evolution) algorithm.
fitBySCE(MODEL, objective = hydromad.getOption("objective"), control = hydromad.getOption("sce.control"), vcov = FALSE)
MODEL |
a model specification created by |
objective |
objective function to maximise, given as a |
control |
settings for the SCE algorithm. See |
vcov |
if |
the best model from those sampled, according to the given
objective
function. Also, these extra elements are inserted:
fit.result |
the result from |
objective |
the |
funevals |
total number of evaluations of the model simulation function. |
timing |
timing vector as returned by |
Felix Andrews felix@nfrac.org
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 <- fitBySCE(modx, control = list(maxit = 5, ncomplex = 2)) summary(foo) ## return value from SCE: str(foo$fit.result) ## plot objective function value convergence over time xyplot(optimtrace(foo, raw = TRUE), screens = 1, type = "p", jitter.x = TRUE, ylim = c(0.7, NA), xlim = c(0, NA), xlab = "function evaluations", ylab = "objective fn. value") + layer(panel.average(..., horiz = FALSE, fun = max, lwd = 2))