| qcov | R Documentation |
compute a covariance matrix consisting of variances (on the diagonal) for quantile estimates and covariances (off-diagonal) between different quantile estimates
qcov(
x,
u,
method = "qor",
dist = "gl",
quantile.type = 7,
bw.correct = TRUE,
params = NULL,
...
)
x |
a numeric vector of data values. |
u |
a numeric vector of probability values in the interval |
method |
the approach used to estimate the quantile density function. Either |
dist |
a character string naming a supported distribution or a quantile function name used by |
quantile.type |
argument for the quantile function. Default is set to |
bw.correct |
logical; if |
params |
a list of parameter values for the chosen distribution. If |
... |
additional arguments to be passed to |
This function computes an approximate covariance matrix for a vector of sample quantile estimators. The covariance structure is based on the asymptotic relationship, for u_i\leq u_j and sample size n,
\mathrm{Cov}(\widehat Q(u_i), \widehat Q(u_j)) \approx
\displaystyle\frac{u_i(1 - u_j)}{n}\, q(u_i)\, q(u_j),
where q(u)=Q'(u) is the quantile density.
The quantile density is estimated by qden. By default, method = "qor" is used, which estimates the quantile density using the quantile optimality ratio (QOR) approach of Prendergast and Staudte (2016). Alternatively, method = "density" estimates the quantile density by fitting a density function and taking its reciprocal at the estimated quantiles.
The argument dist specifies the working distribution used by qden. It may be one of the built-in distributions supported by qden, or a quantile function name when a user-supplied distribution is to be used. If params is NULL, the required distributional parameters are estimated from the data where appropriate.
If method = "qor", the bandwidth is selected using the QOR approach. The argument bw.correct controls the boundary correction used in that bandwidth calculation.
If method = "density", additional arguments in ... are passed to density when density estimation is used directly.
a covariance matrix consisting of variances (on the diagonal) for quantile estimates and covariances (off-diagonal) between different quantile estimates.
Prendergast, L. A., & Staudte, R. G. (2016). Exploiting the quantile optimality ratio in finding confidence intervals for quantiles. Stat, 5(1), 70–81.
Prendergast, L. A., Dedduwakumara, D. S., & Staudte, R. G. (2024). rquest: An R package for hypothesis tests and confidence intervals for quantiles and summary measures based on quantiles. Preprint, pages 1–13.
qden for estimating the quantile density function,
qor for quantile optimality ratio values, and
qrcov for covariance matrices of ratios of linear combinations of quantiles.
set.seed(1234)
x <- rnorm(100)
# Covariance matrix for sample quartiles
qcov(x, c(0.25, 0.5, 0.75))
# Density-based version
qcov(x, c(0.25, 0.5, 0.75), method = "density")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.