objFunVal {hydromad} | R Documentation |
Calculate objective function value for a fitted model.
objFunVal(x, objective, ...) ## S3 method for class 'hydromad' objFunVal(x, objective = hydromad.getOption("objective"), ..., all = FALSE, nan.ok = FALSE) ## Default S3 method: objFunVal(x, objective = hydromad.getOption("objective"), ..., nan.ok = FALSE)
x |
object from which to calculate stats. For the |
objective |
the objective function, or a list of objective functions. See Details. |
... |
ignored. |
all |
passed to |
nan.ok |
by default, an error is thrown if the result is |
The objective function is given as a function with arguments Q
,
X
and ...
, and optionally other arguments. Q
and X
represent observed and modelled flow, respectively.
It should return a single numeric value.
For more advanced use it may also refer to arguments U
(modelled effective rainfall), or P
(observed rainfall), and
more generally it may refer to model
, and so may extract other
items of data, parameters, etc.
The default (unless changed in hydromad.options("objective")
) is
a weighted sum of the R Squared (coefficient of determination) of
square-root transformed data, and the relative bias.
See hydromad.stats
for examples of how to specify other
fit statistics.
the objective function value, or a list of objective function values. They must be numeric and of length one; anything else is an error.
Felix Andrews felix@nfrac.org
hydromad.stats
,
hydromad.object
dat <- data.frame(Q = rnorm(10), X = rnorm(10)) objFunVal(dat, hmadstat("RMSE"))