qcov {rquest}R Documentation

Approximate Covariance Matrix Estimation for Vectors of Quantile Estimators

Description

compute a covariance matrix consisting of variances (on the diagonal) for quantile estimates and covariances (off-diagonal) between different quantile estimates

Usage

qcov(
  x,
  u,
  method = "qor",
  FUN = qor.ln,
  quantile.type = 8,
  bw.correct = TRUE,
  ...
)

Arguments

x

a numeric vector of data values.

u

a numeric vector of probability values in the interval (0,1) specifying the quantiles to be estimated. Note that u must include numeric values between, and not including, 0 and 1 and missing values are not allowed.

method

approach use to estimate the quantile density function. Either "qor" or "density".

FUN

QOR function for the log-normal

quantile.type

argument for the quantile function. Default is set to 8 so that output is consistent with default quantile function use and other functions such as IQR (see help file for quantile() for more details)

bw.correct

replace bw by the values of v when v<=bw (see Prendergast & Staudte (2016b) for more details)

...

additional arguments to be passed to function density when method = “density” is used.

Details

This function computes a covariance matrix for a vector of quantile estimators. This is done via estimating the inverted density function evaluated at the respective quantiles. The default for this is to use the quantile optimality ratio (QOR) approach (Prendergast & Staudte, 2016) which computes an optimal bandwidth. Alternatively, using method = "density" will use the generic density function to estimate the density. The estimated variances and covariance requires estimation of the probability density function. If method = "density", then the function density is used to do this. If needed, additional arguments can be passed to density (see ?density for details on possible additional arguments).

Value

a covariance matrix consisting of variances (on the diagonal) for quantile estimates and covariances (off-diagonal) between different quantile estimates

References

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

Examples

# Create some data
set.seed(1234)
x <- rnorm(100)

# Compute the variance-covariance matrix for sample quartiles.
qcov(x, c(0.25, 0.5, 0.75))

[Package rquest version 1.0.5 Index]