params2ecdf: Parameter Values -> Empirical CDFs

Description Usage Arguments Author(s) See Also Examples

View source: R/params2ecdf.R

Description

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)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
params2ecdf(params, ...)

## Default S3 method:
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 class '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 class '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")

Arguments

params

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

param.names

character vector, names to be used for each parameter in params (by default its column names)

gofs

OPTIONAL. numeric with the values of goodness-of-fit values for each parameter in params (in the same order!)

MinMax

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')

beh.thr

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

weights

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

byrow

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

plot

logical, indicates whether a plot with the Empirical CDF for each model's parameter has to be produced or not

obs

OPTIONAL. Only used when plot=TRUE
Numeric or zoo object with observed values (one for each params), which are used in the output plot

main

an overall title for the plot

nrows

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

ylab

OPTIONAL. Only used when plot=TRUE
a title for the y axis. See plot

col

OPTIONAL. Only used when plot=TRUE
a specification for the default plotting colour. See par

leg.cex

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

leg.pos

OPTIONAL. Only used when plot=TRUE
keyword to be used to position the legend. See legend

cex.axis

OPTIONAL. Only used when plot=TRUE
numeric, magnification to be used for axis annotation relative to the current setting of cex

cex.main

OPTIONAL. Only used when plot=TRUE
numeric, magnification to be used for main titles relative to the current setting of cex

cex.lab

OPTIONAL. Only used when plot=TRUE
numeric, magnification to be used for x and y labels relative to the current setting of cex

verbose

logical, if TRUE, progress messages are printed

...

further arguments passed to the plot function or from other methods

do.png

logical, indicates if all the figures have to be saved into PNG files instead of the screen device

png.width

OPTIONAL. Only used when do.png=TRUE
numeric with the width of the device. See png

png.height

OPTIONAL. Only used when do.png=TRUE
numeric with the height of the device. See png

png.res

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

png.fname

OPTIONAL. Only used when do.png=TRUE
character, with the filename used to store the PNG file

Author(s)

Mauricio Zambrano-Bigiarini, mzb.devel@gmail.com

See Also

wtd.Ecdf, quant2ecdf

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## 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)) 

## End(Not run)

hydroPSO documentation built on April 29, 2020, 9:37 a.m.