quant2ecdf | R Documentation |
This function computes ECDFs for user-defined quantiles of the simulated equivalents, with optional plot
quant2ecdf(sim, ...)
## Default S3 method:
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 class '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 class '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, ...)
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 |
byrow |
logical, indicates whether the computations have to be made for each column or for each row of |
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 |
quantiles.labels |
OPTIONAL. Only used when |
main |
OPTIONAL. Only used when |
ylab |
OPTIONAL. Only used when |
col |
OPTIONAL. Only used when |
leg.cex |
OPTIONAL. Only used when |
leg.pos |
OPTIONAL. Only used when |
cex.axis |
OPTIONAL. Only used when |
cex.main |
OPTIONAL. Only used when |
cex.lab |
OPTIONAL. Only used when |
verbose |
logical, if TRUE, progress messages are printed |
... |
further arguments passed to the |
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)
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
It requires the wtd.Ecdf
function from the Hmisc package.
Mauricio Zambrano-Bigiarini, mzb.devel@gmail.com
wtd.Ecdf
, params2ecdf
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.