hydroPSO (version 0.5-1)

quant2ecdf: Simulated Values -> Empirical CDFs

Description

This function computes ECDFs for user-defined quantiles of the simulated equivalents, with optional plot

Usage

quant2ecdf(sim, ...)
           
# S3 method for default
quant2ecdf(sim, weights=NULL, byrow=TRUE, 
           quantiles.desired= c(0.05, 0.5, 0.95), plot=TRUE, obs=NULL, 
           quantiles.labels= c("Q5", "Q50", "Q95"), main=NULL, 
           ylab="Probability", col="blue", leg.cex=1.2, leg.pos="bottomright", 
           cex.axis=1.2, cex.main=1.2, cex.lab=1.2, verbose=TRUE, ...)
           
# S3 method for matrix
quant2ecdf(sim, weights=NULL, byrow=TRUE, 
           quantiles.desired= c(0.05, 0.5, 0.95), plot=TRUE, obs=NULL, 
           quantiles.labels= c("Q5", "Q50", "Q95"), main=NULL, 
           ylab="Probability", col="blue", leg.cex=1.2, leg.pos="bottomright", 
           cex.axis=1.2, cex.main=1.2, cex.lab=1.2, verbose=TRUE, ...)
           
# S3 method for data.frame
quant2ecdf(sim, weights=NULL, byrow=TRUE, 
           quantiles.desired= c(0.05, 0.5, 0.95), plot=TRUE, obs=NULL, 
           quantiles.labels= c("Q5", "Q50", "Q95"), main=NULL, 
           ylab="Probability", col="blue", leg.cex=1.2, leg.pos="bottomright", 
           cex.axis=1.2, cex.main=1.2, cex.lab=1.2, verbose=TRUE, ...)

Arguments

sim

matrix or data.frame with the simulated equivalents obtained with different parameter sets, which, by default, are stored in columns

weights

numeric vector, values of the weights to be used for computing the quantiles 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 x When the simulated equivalents are stored in columns, byrow must be TRUE When the simulated equivalents are stored in rows, byrow must be FALSE

quantiles.desired

numeric vector, quantiles to be computed. Default values are c(.025, .5, .975) ( => 2.5%, 50%, 97.5% )

plot

logical, indicates if a plot with the ECDFs has to be produced

obs

OPTIONAL. Only used when plot=TRUE Numeric or zoo object with observed values, which are used in the output plot

quantiles.labels

OPTIONAL. Only used when plot=TRUE character vector, names to quantiles.desired. Default value is c("Q5", "Q50", "Q95")

main

OPTIONAL. Only used when plot=TRUE title for the plot

ylab

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

col

OPTIONAL. Only used when plot=TRUE 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 the axis annotation relative to 'cex'. See par

cex.main

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

cex.lab

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

verbose

logical, if TRUE, progress messages are printed

further arguments passed to the plot function or from other methods

Value

A list whose elements x and ecdf correspond to unique sorted values of sim. If the first CDF estimate is greater than zero, a point (min(sim),0) is placed at the beginning of the estimates

Details

Steps used in this function are: 1) Computation of un-weighted quantiles (e.g., Q5, Q50, Q95) for the simulated equivalents 2) Computation of ECDFs for each desired quantile, by weighting the quantiles of each parameter set by its corresponding weights (or less-formal likelihood in GLUE terminology)

See Also

wtd.Ecdf, params2ecdf

Examples

Run this code
# NOT RUN {
# random matrix with 100 simulated values (in columns) corresponding to 10
# different behavioural parameter sets
x <- matrix(rnorm(1000), ncol=10, nrow=100)

# empirical CDFs for the quantiles 0.05, 0.5 and 0.95, with equal weight for 
# each parameter set
quant2ecdf(sim=x, weights=1:10, byrow=FALSE) 
# }

Run the code above in your browser using DataLab