wquantile | R Documentation |
This function computes weighted quantiles of each column (by default, or for each row if specified by the user) of a matrix/data.frame.
It is a wrapper to the wtd.quantile
function of the Hmisc package, specially designed for a matrix containing daily/monthly/seasonal/annual streamflows simulated by different (behavioural) parameter sets.
wquantile(x, weights=NULL, byrow=FALSE, probs=c(.025, .5, .975),
normwt=TRUE, verbose=TRUE)
x |
numeric or matrix for the computation of the weighted quantiles |
weights |
numeric vector, values of the weights to be used for computing the quantiles. See |
byrow |
logical, indicates if the computations have to be made for each column or for each row of |
probs |
numeric vector, quantiles to be computed. |
normwt |
See |
verbose |
logical; if TRUE, progress messages are printed |
A data.frame with the weighted quantiles of each column (by default, or for each row if specified by the user using the byrow
argument) of a matrix/data.frame given as input in x
.
Mauricio Zambrano-Bigiarini, mzb.devel@gmail.com
wtd.quantile
# random matrix with 100 parameter sets (in rows) corresponding to 10
# different parameters
params <- matrix(rnorm(1000), ncol=10, nrow=100)
colnames(params) <- paste("Param", 1:10, sep="")
# empirical CDFs for each one of the 10 parameters of x, with equal weight for
# each one of the 100 parameter sets
wquantile(params, weights=rep(1,100), byrow=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.