It runs a user-defined model to be calibrated/optimised and returns a goodness-of-fit value as measure of model performance, by comparing observations against simulated equivalents
hydromod(param.values, param.files = "ParamFiles.txt", model.drty = getwd(),
exe.fname, stdout= FALSE, stderr="", verbose = FALSE,
out.FUN, out.FUN.args, gof.FUN, gof.FUN.args=list(),
gof.Ini, gof.Fin, date.fmt = "%Y-%m-%d", obs,
do.png=FALSE, png.fname, width = 1200, height = 600, res=90,
main, leg.cex=1.2, tick.tstep= "auto", lab.tstep= "auto",
lab.fmt=NULL)
numeric vector, a single parameter set used to run the model specified in exe.fname
character, file name (full path) storing location and names of the files that have to be modified for each parameter. By default param.files="ParamFiles.txt"
character, path to the executable file of the model specified in exe.fname
. ALL the files required to run the model have to be located within this directory (input files for the model may be located in a different directory, if properly referenced).
character, model command line arguments to be entered through a prompted string to execute the user-defined model
where output to ‘stdout’ or ‘stderr’ should be sent. Possible values are FALSE
(discard output, the default), ""
, to the R console. See system2
By default stdout=FALSE
and any message printed by the model code to the screen will be omitted. This setting is recommended when calibrating the model with hydroPSO
. However, when trying to run the model code with hydromod
by the first time, it is recommend to set stdout=""
, in order to detect if the model was properly executed or not.
By default stderr=""
and any error message of the model code will be printed to the screen
logical; if TRUE, progress messages are printed to the screen
If verbose=TRUE
, the following messages will appear: i) parameter values for each particle; (ii) model execution; iii) extraction of simulated values; and iv) computation of the goodness-of-fit measure
character, name of a valid R function to read the model outputs and transform them into a (zoo) object to be compared against obs
(e.g., see read.table
, read.csv
list, arguments to be passed to out.FUN
character, name of a valid (goodness-of-fit) R function to obtain model performance (e.g., see NSE
, rmse
, etc).
It MUST HAVE -at least- the following two arguments in its definition:
-) sim: numeric with the value(s) simulated by the model specified in exe.fname
-) obs: numeric with the observation(s) used to compute model's performance by comparison against sim
list, arguments additional to sim and obs that need to be passed to gof.FUN
(e.g., see j argument in mNSE
)
OPTIONAL. Character with the starting date used in the goodness-of-fit function
It is used to subset obs
(if necessary), AND to define the time period to compare simulated with observed values
OPTIONAL. Character with the ending date used in the goodness-of-fit function
It is used to subset obs
(if necessary), AND to define the time period to compare simulated with observed values
character, format in which the dates are stored in Sim.Ini
, Sim.Fin
, gof.Ini
, gof.Fin
, e.g. %Y-%m-%d. See format
in as.Date
(zoo) object with the observed values
OPTIONAL. Used only when do.png=TRUE
Name of the PNG file to be created within the model.drty
directory. The default value is ‘Obs_vs_Sim.png’
OPTIONAL. Used only when do.png=TRUE
numeric, width of the output PNG image
OPTIONAL. Used only when do.png=TRUE
numeric, height of the output PNG image
OPTIONAL. Used only when do.png=TRUE
numeric, resolution of the output PNG image
OPTIONAL. Used only when do.png=TRUE
character, representing the main title of the plot comparing observed and simulated values
See ggof
See ggof
See ggof
See ggof
A list of two elements:
numeric, with the simulated values obtained by running the model
numeric, goodness-of-fit value representing how close each one of the simulated values in sim
are to their observed counterparts, by using the USER-DEFINED gof.FUN
function