This function computes (weighted) empirical CDFs (ECDFs) for each calibrated parameter, by using the parameter values obtained during the optimisation with hydroPSO
(with optional plot)
params2ecdf(params, ...)# S3 method for default
params2ecdf(params, param.names=NULL, gofs=NULL, MinMax=NULL,
beh.thr=NA, weights=NULL, byrow=FALSE, plot=TRUE, obs=NULL, main=NULL,
nrows="auto", ylab="Probability", col="blue", leg.cex=1.2,
leg.pos="topleft", cex.axis=1.2, cex.main=1.2, cex.lab=1.2,
verbose=TRUE, ..., do.png=FALSE, png.width=1500, png.height=900,
png.res=90, png.fname="Params_ECDFs.png")
# S3 method for matrix
params2ecdf(params, param.names=colnames(params), gofs=NULL,
MinMax=NULL, beh.thr=NA, weights, byrow=FALSE, plot=TRUE, obs=NULL,
main=NULL, nrows="auto", ylab="Probability", col="blue", leg.cex=1.2,
leg.pos="topleft", cex.axis=1.2, cex.main=1.2, cex.lab=1.2,
verbose=TRUE, ..., do.png=FALSE, png.width=1500, png.height=900,
png.res=90, png.fname="Params_ECDFs.png")
# S3 method for data.frame
params2ecdf(params, param.names=colnames(params), gofs=NULL,
MinMax=NULL, beh.thr=NA, weights, byrow=FALSE, plot=TRUE, obs=NULL,
main=NULL, nrows="auto", ylab="Probability", col="blue", leg.cex=1.2,
leg.pos="topleft", cex.axis=1.2, cex.main=1.2, cex.lab=1.2,
verbose=TRUE, ..., do.png=FALSE, png.width=1500, png.height=900,
png.res=90, png.fname="Params_ECDFs.png")
matrix or data.frame with the parameter values, where each row represent a different parameter set and each column represent the value of a different model parameter
character vector, names to be used for each parameter in params
(by default its column names)
OPTIONAL. numeric with the values of goodness-of-fit values for each parameter in params
(in the same order!)
OPTIONAL. character, indicates if the optimum value in params
corresponds to the minimum or maximum of the the objective function. Only used to identify the optimum in the plot
Valid values are in: c('min', 'max')
numeric, used for selecting only the behavioural parameter sets, i.e. those with a goodness-of-fit value (as given in gofs
) greater/less than or equal to beh.thr
, depending on the value of MinMax
By default beh.thr=NA
and all the parameter sets are considered for the subsequent anlysis
numeric vector, values of the weights to be used for computing the empirical CDFs
Omitting the weights
argument or specifying NULL
or a zero-length vector will result in the usual un-weighted estimates
logical, indicates whether the computations have to be made for each column or for each row of params
When the parameter sets are stored in rows, i.e. values for different model's parameter are stored in columns, byrow
must be FALSE
When the parameter sets are stored in columns, i.e. values for different model's parameter are stored in rows, byrow
must be TRUE
logical, indicates whether a plot with the Empirical CDF for each model's parameter has to be produced or not
OPTIONAL. Only used when plot=TRUE
Numeric or zoo object with observed values (one for each params
), which are used in the output plot
an overall title for the plot
OPTIONAL. Only used when plot=TRUE
numeric, number of rows to be used in the plotting window. If nrows
is set to auto, the number of rows is automatically computed depending on the number of columns of params
OPTIONAL. Only used when plot=TRUE
a title for the y axis. See plot
OPTIONAL. Only used when plot=TRUE
a specification for the default plotting colour. See par
OPTIONAL. Only used when plot=TRUE
character expansion factor *relative* to current 'par("cex")'. Used for text, and provides the default for 'pt.cex' and 'title.cex'. Default value = 1.2
OPTIONAL. Only used when plot=TRUE
keyword to be used to position the legend. See legend
OPTIONAL. Only used when plot=TRUE
numeric, magnification to be used for axis annotation relative to the current setting of cex
OPTIONAL. Only used when plot=TRUE
numeric, magnification to be used for main titles relative to the current setting of cex
OPTIONAL. Only used when plot=TRUE
numeric, magnification to be used for x and y labels relative to the current setting of cex
logical, if TRUE, progress messages are printed
further arguments passed to the plot
function or from other methods
logical, indicates if all the figures have to be saved into PNG files instead of the screen device
OPTIONAL. Only used when do.png=TRUE
numeric with the width of the device. See png
OPTIONAL. Only used when do.png=TRUE
numeric with the height of the device. See png
OPTIONAL. Only used when do.png=TRUE
numeric with the nominal resolution in ppi which will be recorded in the PNG file, if a positive integer of the device. See png
OPTIONAL. Only used when do.png=TRUE
character, with the filename used to store the PNG file
# NOT RUN {
# Setting the user's home directory as working directory
setwd("~")
# matrix with 100 random uniform parameter sets (in rows) for 10 different model's
# parameters (in columns)
params <- matrix(rnorm(1000), ncol=10, nrow=100)
colnames(params) <- paste("Param", 1:10, sep="")
# empirical CDFs for each one of the 10 parameters in 'params', with equal weight
# for each one of the 100 parameter sets
params2ecdf(params, weights=rep(1,100))
# }
Run the code above in your browser using DataLab